Skip to content
This repository has been archived by the owner on Jul 9, 2018. It is now read-only.

Latest commit

 

History

History
13 lines (10 loc) · 730 Bytes

README.md

File metadata and controls

13 lines (10 loc) · 730 Bytes

travetto: Util

Common utilities for executing HTTP requests and any other future catch alls.

HTTP Requests

The http request functionality exists to allow for simple usage of the node http and https modules. This functionality exists, in lieu of alternatives, as a means to provide the smallest footprint possible. The logic itself is simple:

request(opts: http.RequestOptions & { url: string }, data?: any): Promise<string>;
request(opts: http.RequestOptions & { url: string, pipeTo: any }, data?: any): Promise<http.IncomingMessage>;
requestJSON<T, U>(opts: http.RequestOptions & { url: string }, data?: U): Promise<T>;