@element-ts/palloadium
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

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.

Readme

Keywords

none

Package Sidebar

Install

npm i @element-ts/palloadium

Weekly Downloads

2

Version

1.0.0

License

MIT

Unpacked Size

27.6 kB

Total Files

18

Last publish

Collaborators

  • ejc