http-basic
- Version 8.1.3
- Published
- 43.7 kB
- 4 dependencies
- MIT license
Install
npm i http-basicyarn add http-basicpnpm add http-basicOverview
Very low level wrapper arround http.request/https.request
Index
Functions
Interfaces
Type Aliases
Functions
function request
request: { ( method: HttpVerb, url: string | URL, options: Options | null | void, callback: Callback ): void | NodeJS.WritableStream; (method: HttpVerb, url: any, callback: Callback): any;};Interfaces
interface CachedResponse
interface CachedResponse {}property body
body: NodeJS.ReadableStream;property headers
headers: Headers;property requestHeaders
requestHeaders: Headers;property requestTimestamp
requestTimestamp: number;property statusCode
statusCode: number;interface ICache
interface ICache {}property updateResponseHeaders
updateResponseHeaders?: ( url: string, response: Pick<CachedResponse, 'headers' | 'requestTimestamp'>) => void;method getResponse
getResponse: ( url: string, cb: (err: Error | null, response: CachedResponse | null) => void) => void;method invalidateResponse
invalidateResponse: (url: string, cb: (err: Error | null) => void) => void;method setResponse
setResponse: (url: string, response: CachedResponse | null) => void;interface Options
interface Options {}property agent
agent?: Agent | boolean;property allowRedirectHeaders
allowRedirectHeaders?: string[];property cache
cache?: 'file' | 'memory' | ICache;property canCache
canCache?: ( res: Response<NodeJS.ReadableStream>, defaultValue: boolean) => boolean;property duplex
duplex?: boolean;property followRedirects
followRedirects?: boolean;property gzip
gzip?: boolean;property headers
headers?: Headers;property ignoreFailedInvalidation
ignoreFailedInvalidation?: boolean;property isExpired
isExpired?: (cachedResponse: CachedResponse, defaultValue: boolean) => boolean;property isMatch
isMatch?: ( requestHeaders: Headers, cachedResponse: CachedResponse, defaultValue: boolean) => boolean;property maxRedirects
maxRedirects?: number;property maxRetries
maxRetries?: number;property retry
retry?: | boolean | (( err: NodeJS.ErrnoException | null, res: Response<NodeJS.ReadableStream> | void, attemptNumber: number ) => boolean);property retryDelay
retryDelay?: | number | (( err: NodeJS.ErrnoException | null, res: Response<NodeJS.ReadableStream> | void, attemptNumber: number ) => number);property socketTimeout
socketTimeout?: number;property timeout
timeout?: number;Type Aliases
Package Files (6)
Dependencies (4)
Dev Dependencies (6)
Peer Dependencies (0)
No peer dependencies.
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/http-basic.
- Markdown[](https://www.jsdocs.io/package/http-basic)
- HTML<a href="https://www.jsdocs.io/package/http-basic"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 1520 ms. - Missing or incorrect documentation? Open an issue for this package.
