Base class in Coolio http package, which allows to perform API calls.
▪ T
HttpClient
+ new HttpClient(config
: HttpClientConfig‹T›): HttpClient
Defined in packages/http/src/httpClient.ts:122
Parameters:
Returns: HttpClient
▸ addInterceptor(interceptor
: HttpInterceptor): this
Defined in packages/http/src/httpClient.ts:148
Adds an interceptor to the client. Interceptor can be written either as class or as a function, which may mutate request options and post-process response from server. Multiple interceptors can be added to a single HttpClient. They can perform as:
cache
error handler
authorizer
logger
auto-retry
redirection handler
Parameters:
Returns: this
▸ delete<Body>(uri
: string, options?
: HttpOptions): Promise‹HttpResponse‹Body››
Defined in packages/http/src/httpClient.ts:212
Performs a DELETE request.
Type parameters:
▪ Body: T
Parameters:
Returns: Promise‹HttpResponse‹Body››
▸ get<Body>(uri
: string, options?
: HttpOptions): Promise‹HttpResponse‹Body››
Defined in packages/http/src/httpClient.ts:159
Performs a GET request.
Type parameters:
▪ Body: T
Parameters:
Returns: Promise‹HttpResponse‹Body››
▸ patch<Body>(uri
: string, options?
: HttpOptions): Promise‹HttpResponse‹Body››
Defined in packages/http/src/httpClient.ts:199
Performs a PATCH request.
Type parameters:
▪ Body: T
Parameters:
Returns: Promise‹HttpResponse‹Body››
▸ post<Body>(uri
: string, options?
: HttpOptions): Promise‹HttpResponse‹Body››
Defined in packages/http/src/httpClient.ts:173
Performs a POST request.
Type parameters:
▪ Body: T
Parameters:
Returns: Promise‹HttpResponse‹Body››
▸ put<Body>(uri
: string, options?
: HttpOptions): Promise‹HttpResponse‹Body››
Defined in packages/http/src/httpClient.ts:186
Performs a PUT request.
Type parameters:
▪ Body: T
Parameters:
Returns: Promise‹HttpResponse‹Body››
▸ remove<Body>(uri
: string, options?
: HttpOptions): Promise‹HttpResponse‹any››
Defined in packages/http/src/httpClient.ts:227
Performs a DELETE request.
Type parameters:
▪ Body: T
Parameters:
Returns: Promise‹HttpResponse‹any››
▸ request<Body>(url
: string, options
: HttpRequestOptions): Promise‹HttpResponse‹Body››
Defined in packages/http/src/httpClient.ts:229
Type parameters:
▪ Body: T
Parameters:
Returns: Promise‹HttpResponse‹Body››
Name
Type
config
Name
Type
Description
interceptor
Interceptor that will process every request/response in this HttpClient.
Name
Type
Description
uri
string
Address of HTTP endpoint
options?
Additional HttpOptions passed with request
Name
Type
Description
uri
string
Address of HTTP endpoint
options?
Additional HttpOptions passed with request
Name
Type
Description
uri
string
Address of HTTP endpoint
options?
Additional HttpOptions passed with request
Name
Type
Description
uri
string
Address of HTTP endpoint
options?
Additional HttpOptions passed with request
Name
Type
Description
uri
string
Address of HTTP endpoint
options?
Additional HttpOptions passed with request
Name
Type
Description
uri
string
Address of HTTP endpoint
options?
Additional HttpOptions passed with request
Name
Type
url
string
options
▪ T
↳ HttpRequestError
+ new HttpRequestError(options
: NormalizedHttpOptions, message?
: undefined | string): HttpRequestError
Defined in packages/http/src/httpRequestError.ts:6
Parameters:
Returns: HttpRequestError
• message: string
Inherited from HttpRequestError.message
Defined in node_modules/typescript/lib/lib.es5.d.ts:974
• name: string
Inherited from HttpRequestError.name
Defined in node_modules/typescript/lib/lib.es5.d.ts:973
• options: NormalizedHttpOptions
Defined in packages/http/src/httpRequestError.ts:8
Optional
stack• stack? : undefined | string
Inherited from HttpRequestError.stack
Overrides HttpRequestError.stack
Defined in node_modules/typescript/lib/lib.es5.d.ts:975
Static
Error▪ Error: ErrorConstructor
Defined in node_modules/typescript/lib/lib.es5.d.ts:984
Name
Type
options
message?
undefined | string
+ new HttpResponseHeaders(headers
: IncomingHttpHeaders | | Headers | string):
Defined in
Returns:
Defined in
Defined in
Defined in
Name | Type |
| string |
Name | Type |
| string |
| any |
Name | Type | Default |
| {} |
▪ T
↳ HttpResponseError
+ new HttpResponseError(response
: HttpResponse‹T›, message?
: undefined | string): HttpResponseError
Defined in packages/http/src/httpResponseError.ts:8
Parameters:
Returns: HttpResponseError
• message: string
Inherited from HttpRequestError.message
Defined in node_modules/typescript/lib/lib.es5.d.ts:974
• name: string
Inherited from HttpRequestError.name
Defined in node_modules/typescript/lib/lib.es5.d.ts:973
• response: HttpResponse‹T›
Defined in packages/http/src/httpResponseError.ts:10
Optional
stack• stack? : undefined | string
Inherited from HttpRequestError.stack
Overrides HttpRequestError.stack
Defined in node_modules/typescript/lib/lib.es5.d.ts:975
• status: HttpCode
Defined in packages/http/src/httpResponseError.ts:7
Static
Error▪ Error: ErrorConstructor
Defined in node_modules/typescript/lib/lib.es5.d.ts:984
IncomingHttpHeaders | | Headers | string
Name
Type
response
HttpResponse‹T›
message?
undefined | string