@element-ts/palloadium
A type-safe http/s request library.
Last updated a month ago by ejc .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @element-ts/palloadium 
SYNC missed versions from official npm registry.

palladium

A type-safe http/s request library.

Import

Import what you need. You will most likely not need to import all of these.

import {
    PdRequest,
    PdResponse,
    PdMethod
} from "element-ts/palladium";

Example

Creating a Request

const req: PdRequest = new PdRequest();
req.setMethod(PdMethod.Post);
req.setUrl("my-api-address");
req.setBody({
    name: "Elijah Cobb"
})
req.setBearerToken("my-cool-token");

Fetching Response

const res: PdResponse = await req.request();
const code: number = res.statusCode;
const body: object | undefined = res.getJSON()

Documentation

You can view the declaration files or even the source code on GitHub.

Bugs

If you find any bugs please create an issue on GitHub or if you are old-fashioned email me at elijah@elijahcobb.com.

Current Tags

  • 1.0.0                                ...           latest (a month ago)

1 Versions

  • 1.0.0                                ...           a month ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 3
Dependencies (3)
Dev Dependencies (6)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |