Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
▪ T
↳ HttpRequestError
+ new HttpRequestError(options
: NormalizedHttpOptions, message?
: undefined | string): HttpRequestError
Defined in packages/http/src/httpRequestError.ts:6
Parameters:
Name
Type
options
message?
undefined | string
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
Base class in Coolio http package, which allows to perform API calls.
▪ T
HttpClient
Parameters:
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
Performs a DELETE request.
Type parameters:
▪ Body: T
Parameters:
Performs a GET request.
Type parameters:
▪ Body: T
Parameters:
Performs a PATCH request.
Type parameters:
▪ Body: T
Parameters:
Performs a POST request.
Type parameters:
▪ Body: T
Parameters:
Performs a PUT request.
Type parameters:
▪ Body: T
Parameters:
Performs a DELETE request.
Type parameters:
▪ Body: T
Parameters:
Type parameters:
▪ Body: T
Parameters:
+ new HttpClient(config
: ‹T›):
Defined in
Returns:
▸ addInterceptor(interceptor
: ): this
Defined in
▸ delete<Body>(uri
: string, options?
: ): Promise‹‹Body››
Defined in
Returns: Promise‹‹Body››
▸ get<Body>(uri
: string, options?
: ): Promise‹‹Body››
Defined in
Returns: Promise‹‹Body››
▸ patch<Body>(uri
: string, options?
: ): Promise‹‹Body››
Defined in
Returns: Promise‹‹Body››
▸ post<Body>(uri
: string, options?
: ): Promise‹‹Body››
Defined in
Returns: Promise‹‹Body››
▸ put<Body>(uri
: string, options?
: ): Promise‹‹Body››
Defined in
Returns: Promise‹‹Body››
▸ remove<Body>(uri
: string, options?
: ): Promise‹‹any››
Defined in
Returns: Promise‹‹any››
▸ request<Body>(url
: string, options
: ): Promise‹‹Body››
Defined in
Returns: Promise‹‹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
• CAMEL_CASE: = "CAMEL_CASE"
Defined in packages/http/src/helpers/caseConversion.helper.ts:5
• KEBAB_CASE: = "KEBAB_CASE"
Defined in packages/http/src/helpers/caseConversion.helper.ts:8
• PASCAL_CASE: = "PASCAL_CASE"
Defined in packages/http/src/helpers/caseConversion.helper.ts:7
• SNAKE_CASE: = "SNAKE_CASE"
Defined in packages/http/src/helpers/caseConversion.helper.ts:6
• JSON: = "application/json"
Defined in packages/http/src/contentType.ts:3
• TEXT: = "text/plain"
Defined in packages/http/src/contentType.ts:2
• URL_ENCODED: = "application/x-www-form-urlencoded"
Defined in packages/http/src/contentType.ts:5
• VND_JSON: = "application/vnd.api+json"
Defined in packages/http/src/contentType.ts:4
• DELETE: = "DELETE"
Defined in packages/http/src/httpClient.types.ts:49
• GET: = "GET"
Defined in packages/http/src/httpClient.types.ts:46
• PATCH: = "PATCH"
Defined in packages/http/src/httpClient.types.ts:48
• POST: = "POST"
Defined in packages/http/src/httpClient.types.ts:45
• PUT: = "PUT"
Defined in packages/http/src/httpClient.types.ts:47
BodyParserOptions
Optional
bodyCasing• bodyCasing? : BodyCasing
Defined in packages/http/src/bodyParser.ts:9
Optional
defaultParser• defaultParser? : BodyParserImplementation
Defined in packages/http/src/bodyParser.ts:10
CreateSimpleServerParams
• endpoints: SimpleEndpoint[]
Defined in packages/http/src/testing/createSimpleServer.helper.ts:15
• headers: OutgoingHttpHeaders
Defined in packages/http/src/testing/createSimpleServer.helper.ts:14
• status: number
Defined in packages/http/src/testing/createSimpleServer.helper.ts:13
BodySerializerOptions
Optional
bodyCasing• bodyCasing? : BodyCasing
Defined in packages/http/src/bodySerializer.ts:10
• ACCEPTED: = 202
Defined in packages/http/src/httpCodes.ts:6
• BAD_GATEWAY: = 502
Defined in packages/http/src/httpCodes.ts:45
• BAD_REQUEST: = 400
Defined in packages/http/src/httpCodes.ts:18
• CONFLICT: = 409
Defined in packages/http/src/httpCodes.ts:26
• CONTINUE: = 100
Defined in packages/http/src/httpCodes.ts:2
• CREATED: = 201
Defined in packages/http/src/httpCodes.ts:5
• EXPECTATION_FAILED: = 417
Defined in packages/http/src/httpCodes.ts:34
• FORBIDDEN: = 403
Defined in packages/http/src/httpCodes.ts:20
• FOUND: = 302
Defined in packages/http/src/httpCodes.ts:13
• GATEWAY_TIMEOUT: = 504
Defined in packages/http/src/httpCodes.ts:47
• GONE: = 410
Defined in packages/http/src/httpCodes.ts:27
• HTTP_VERSION_NOT_SUPPORTED: = 505
Defined in packages/http/src/httpCodes.ts:48
• IM_A_TEAPOT: = 418
Defined in packages/http/src/httpCodes.ts:35
• INTERNAL_SERVER_ERROR: = 500
Defined in packages/http/src/httpCodes.ts:43
• LENGTH_REQUIRED: = 411
Defined in packages/http/src/httpCodes.ts:28
• METHOD_NOT_ALLOWED: = 405
Defined in packages/http/src/httpCodes.ts:22
• MOVED_PERMANENTLY: = 301
Defined in packages/http/src/httpCodes.ts:12
• MULTIPLE_CHOICES: = 300
Defined in packages/http/src/httpCodes.ts:11
• NETWORK_AUTHENTICATION_REQUIRED: = 511
Defined in packages/http/src/httpCodes.ts:49
• NONAUTHORITATIVE_INFORMATION: = 203
Defined in packages/http/src/httpCodes.ts:7
• NOT_ACCEPTABLE: = 406
Defined in packages/http/src/httpCodes.ts:23
• NOT_FOUND: = 404
Defined in packages/http/src/httpCodes.ts:21
• NOT_IMPLEMENTED: = 501
Defined in packages/http/src/httpCodes.ts:44
• NOT_MODIFIED: = 304
Defined in packages/http/src/httpCodes.ts:15
• NO_CONTENT: = 204
Defined in packages/http/src/httpCodes.ts:8
• OK: = 200
Defined in packages/http/src/httpCodes.ts:4
• PARTIAL_CONTENT: = 206
Defined in packages/http/src/httpCodes.ts:10
• PAYLOAD_TOO_LARGE: = 413
Defined in packages/http/src/httpCodes.ts:30
• PERMANENT_REDIRECT: = 308
Defined in packages/http/src/httpCodes.ts:17
• PRECONDITION_FAILED: = 412
Defined in packages/http/src/httpCodes.ts:29
• PRECONDITION_REQUIRED: = 428
Defined in packages/http/src/httpCodes.ts:39
• PROXY_AUTHENTICATION_REQUIRED: = 407
Defined in packages/http/src/httpCodes.ts:24
• RANGE_NOT_SATISFIABLE: = 416
Defined in packages/http/src/httpCodes.ts:33
• REQUEST_HEADER_FIELDS_TOO_LARGE: = 431
Defined in packages/http/src/httpCodes.ts:41
• REQUEST_TIMEOUT: = 408
Defined in packages/http/src/httpCodes.ts:25
• RESET_CONTENT: = 205
Defined in packages/http/src/httpCodes.ts:9
• SEE_OTHER: = 303
Defined in packages/http/src/httpCodes.ts:14
• SERVICE_UNAVAILABLE: = 503
Defined in packages/http/src/httpCodes.ts:46
• SWITCHING_PROTOCOLS: = 101
Defined in packages/http/src/httpCodes.ts:3
• TEMPORARY_REDIRECT: = 307
Defined in packages/http/src/httpCodes.ts:16
• TOO_EARLY: = 425
Defined in packages/http/src/httpCodes.ts:37
• TOO_MANY_REQUESTS: = 429
Defined in packages/http/src/httpCodes.ts:40
• UNAUTHORIZED: = 401
Defined in packages/http/src/httpCodes.ts:19
• UNAVAILABLE_FOR_LEGAL_REASONS: = 451
Defined in packages/http/src/httpCodes.ts:42
• UNPROCESSABLE_ENTITY: = 422
Defined in packages/http/src/httpCodes.ts:36
• UNSUPPORTED_MEDIA_TYPE: = 415
Defined in packages/http/src/httpCodes.ts:32
• UPGRADE_REQUIRED: = 426
Defined in packages/http/src/httpCodes.ts:38
• URI_TOO_LONG: = 414
Defined in packages/http/src/httpCodes.ts:31
HttpResponseHeaders
+ new HttpResponseHeaders(headers
: IncomingHttpHeaders | HttpHeaders | Headers | string): HttpResponseHeaders
Defined in packages/http/src/httpResponseHeaders.ts:6
Parameters:
Name
Type
Default
headers
{}
Returns: HttpResponseHeaders
• map: Record‹string, string›
Defined in packages/http/src/httpResponseHeaders.ts:6
▸ get(key
: string): undefined | string
Defined in packages/http/src/httpResponseHeaders.ts:33
Parameters:
Name
Type
key
string
Returns: undefined | string
▸ set(key
: string, value
: any): void
Defined in packages/http/src/httpResponseHeaders.ts:29
Parameters:
Name
Type
key
string
value
any
Returns: void
▪ T
↳ HttpResponseError
+ new HttpResponseError(response
: HttpResponse‹T›, message?
: undefined | string): HttpResponseError
Defined in packages/http/src/httpResponseError.ts:8
Parameters:
Name
Type
response
message?
undefined | string
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
A set of configuration options, which allows to perform
▪ T
HttpClientConfig
Optional
baseUrl• baseUrl? : undefined | string
URL that is applied to all requests without specified protocol and domain.
Optional
bodyParserOptional
bodySerializerOptional
defaultHeadersProviderOld way of passing global headers to requests. To add headers dynamically, you can use an interceptor instead. To add a set of static headers, pass them to request handler options directly.
deprecated
Optional
queryParserOptions• queryParserOptions? : qs.IParseOptions
Allow to parse query options in a different way than the standard one.
Optional
querySerializerOptions• querySerializerOptions? : qs.IStringifyOptions
Allow to serialize query options in a different way than the standard one.
An implementation of request handler, which handles "low-level" HTTP communication. Result of executing a request via RequestHandler is a normalized object, which can be further processed by interceptors and HttpClient.
Optional
requestTimeout• requestTimeout? : undefined | number
Standard timeout, triggered when server does not respond with headers within specified period of time.
IncomingHttpHeaders | | Headers | string
‹T›
Returns: ‹Body›
• body? :
Defined in
Defined in
• headers? :
Defined in
• method:
Defined in
• mode? :
Defined in
Defined in
Defined in
Defined in
• bodyParser? : ‹T›
Defined in
A utility that parses and normalizes body of a response received from server. Can be used to decode JSON object, URL-encoded body or plain text. Built-in supports case-conversion.
• bodySerializer? :
Defined in
A utility that parses and normalizes body of a request sent to server. Can be used to encode JSON object, URL-encoded body or plain text. Built-in supports case-conversion.
• defaultHeadersProvider? :
Defined in
Defined in
Defined in
• requestHandler:
Defined in
For Node.js environment, use
For browser environments, use
For React Native and any other environment, use
Defined in
default
Defined in
Defined in
Name
Type
request
Name
Type
request
HttpFetch‹Body›
options
▪ T
↳ HttpResponse
• headers: HttpResponseHeaders
Inherited from RawHttpResponse.headers
Defined in packages/http/src/httpClient.types.ts:5
• ok: boolean
Inherited from RawHttpResponse.ok
Defined in packages/http/src/httpClient.types.ts:6
• redirected: boolean
Inherited from RawHttpResponse.redirected
Defined in packages/http/src/httpClient.types.ts:7
• status: number
Inherited from RawHttpResponse.status
Defined in packages/http/src/httpClient.types.ts:8
• statusText: string
Inherited from RawHttpResponse.statusText
Defined in packages/http/src/httpClient.types.ts:9
• url: string
Inherited from RawHttpResponse.url
Defined in packages/http/src/httpClient.types.ts:10
▸ abort(): void
Inherited from RawHttpResponse.abort
Defined in packages/http/src/httpClient.types.ts:16
Returns: void
▸ arrayBuffer(): Promise‹ArrayBuffer›
Inherited from RawHttpResponse.arrayBuffer
Defined in packages/http/src/httpClient.types.ts:12
Returns: Promise‹ArrayBuffer›
▸ parsedBody(): Promise‹T›
Defined in packages/http/src/httpClient.types.ts:20
Returns: Promise‹T›
▸ text(): Promise‹string›
Inherited from RawHttpResponse.text
Defined in packages/http/src/httpClient.types.ts:14
Returns: Promise‹string›
HttpRequestHandlerOptions
Optional
defaultRequestOptions• defaultRequestOptions? : ClientRequestArgs
Defined in packages/http/src/requestHandlers/http.requestHandler.ts:10
MockOptions
• endpoints: Endpoint[]
Defined in packages/http/src/requestHandlers/mock.requestHandler.ts:33
Log
• duration: number
Defined in packages/http/src/interceptors/loggingInterceptor.ts:7
Optional
error• error? : any
Defined in packages/http/src/interceptors/loggingInterceptor.ts:6
• request: HttpRequestOptions
Defined in packages/http/src/interceptors/loggingInterceptor.ts:4
Optional
response• response? : HttpResponse
Defined in packages/http/src/interceptors/loggingInterceptor.ts:5
HttpResponseOptions
Optional
body• body? : NormalizedHttpBody
Defined in packages/http/src/httpResponse.ts:11
Optional
headers• headers? : HttpHeaders
Defined in packages/http/src/httpResponse.ts:9
• status: number
Defined in packages/http/src/httpResponse.ts:10
Optional
url• url? : undefined | string
Defined in packages/http/src/httpResponse.ts:8
Ƭ BodyParser: function
Defined in packages/http/src/httpClient.types.ts:23
▸ (response
: RawHttpResponse): HttpResponse‹T›
Parameters:
Name
Type
response
Ƭ BodyParserImplementation: function
Defined in packages/http/src/bodyParser.ts:6
▸ (rawResponse
: RawHttpResponse): Promise‹any›
Parameters:
Name
Type
rawResponse
Ƭ BodySerializer: function
Defined in packages/http/src/httpClient.types.ts:25
▸ (request
: HttpOptions): NormalizedHttpBody
Parameters:
Name
Type
request
Ƭ BufferEncoding: "ascii" | "utf8" | "utf-8" | "utf16le" | "ucs2" | "ucs-2" | "base64" | "latin1" | "binary" | "hex"
Defined in packages/http/src/helpers/encoder.helper.ts:5
Ƭ ContentTypeMap: Record‹keyof typeof ContentTypeRegex, T›
Defined in packages/http/src/contentType.ts:14
Ƭ HeadersProvider: function
Defined in packages/http/src/httpClient.ts:27
▸ (host
: string): Promise‹HttpHeaders› | HttpHeaders
Parameters:
Name
Type
host
string
Ƭ HttpBody: object | TypedArray | string
Defined in packages/http/src/httpClient.types.ts:29
Ƭ HttpFetch: function
Defined in packages/http/src/httpClient.types.ts:27
▸ (): Promise‹HttpResponse‹Body››
Ƭ HttpHeaders: Record‹string, string | number | boolean | undefined | null›
Defined in packages/http/src/httpClient.types.ts:31
Ƭ HttpInterceptor: HttpInterceptorFunction | HttpInterceptorInterface
Defined in packages/http/src/httpClient.types.ts:42
Ƭ HttpInterceptorFunction: function
Defined in packages/http/src/httpClient.types.ts:37
▸ <Body>(request
: HttpFetch‹Body›, options
: NormalizedHttpOptions): HttpFetch‹Body›
Type parameters:
▪ Body
Parameters:
Name
Type
request
options
Ƭ HttpOptions: Partial‹HttpRequestOptions›
Defined in packages/http/src/httpClient.types.ts:64
Ƭ HttpRequestHandler: function
Defined in packages/http/src/httpClient.types.ts:79
▸ (requestOptions
: NormalizedHttpOptions): Promise‹RawHttpResponse›
Parameters:
Name
Type
requestOptions
Ƭ MockHttpRequestHandler: HttpRequestHandler & object
Defined in packages/http/src/requestHandlers/mock.requestHandler.ts:36
Ƭ NormalizedHttpBody: string | TypedArray | undefined
Defined in packages/http/src/httpClient.types.ts:66
Ƭ PromiseFunction: function
Defined in packages/http/src/helpers/parsedBodyCache.helper.ts:1
▸ (): Promise‹T›
Ƭ RequestMode: "navigate" | "same-origin" | "no-cors" | "cors"
Defined in packages/http/src/httpClient.types.ts:52
Const
DEFAULT_REQUEST_TIMEOUT_MS• DEFAULT_REQUEST_TIMEOUT_MS: number = 5 60 1000
Defined in packages/http/src/httpClient.ts:25
Default request timeout - 5 minutes.
Const
DONE• DONE: 4 = 4
Defined in packages/http/src/requestHandlers/xhr.requestHandler.ts:7
Const
HEADERS_RECEIVED• HEADERS_RECEIVED: 2 = 2
Defined in packages/http/src/requestHandlers/xhr.requestHandler.ts:6
• TypedArray: any
Defined in packages/http/src/httpClient.types.ts:2
Defined in packages/http/src/helpers/encoder.helper.ts:1
Const
symbol• symbol: unique symbol = Symbol('HttpResponseError')
Defined in packages/http/src/httpRequestError.ts:3
Defined in packages/http/src/httpResponseError.ts:4
Const
bodyParser▸ bodyParser(__namedParameters
: object): (Anonymous function)
Defined in packages/http/src/bodyParser.ts:13
Parameters:
▪Default value
__namedParameters: object= {}
Name
Type
bodyCasing
defaultParser
Returns: (Anonymous function)
Const
bodySerializer▸ bodySerializer(__namedParameters
: object): BodySerializer
Defined in packages/http/src/bodySerializer.ts:13
Parameters:
▪Default value
__namedParameters: object= {}
Name
Type
bodyCasing
Returns: BodySerializer
Const
cacheParsedBody▸ cacheParsedBody<T>(parsedBody
: PromiseFunction‹T›): PromiseFunction‹T›
Defined in packages/http/src/helpers/parsedBodyCache.helper.ts:9
Type parameters:
▪ T
Parameters:
Name
Type
parsedBody
Returns: PromiseFunction‹T›
Const
createAsyncBodyHandler▸ createAsyncBodyHandler<T>(): object
Defined in packages/http/src/requestHandlers/xhr.requestHandler.ts:9
Type parameters:
▪ T
Returns: object
call(): Promise‹T›
onBodyFailure(failer
: function): void
onBodyReceived(getter
: function): void
Const
createErrorInterceptor▸ createErrorInterceptor(): HttpInterceptorFunction
Defined in packages/http/src/interceptors/errorInterceptor.ts:4
Returns: HttpInterceptorFunction
Const
createHttpResponse▸ createHttpResponse(__namedParameters
: object): HttpResponse
Defined in packages/http/src/httpResponse.ts:14
Parameters:
▪ __namedParameters: object
Name
Type
Default
body
undefined | string | Uint8Array‹› | Uint8ClampedArray‹› | Uint16Array‹› | Uint32Array‹› | Int8Array‹› | Int16Array‹› | Int32Array‹› | Float32Array‹› | Float64Array‹›
-
headers
undefined | object
-
status
number
-
url
string
""
Returns: HttpResponse
Const
createLoggingInterceptor▸ createLoggingInterceptor(__namedParameters
: object): HttpInterceptorFunction
Defined in packages/http/src/interceptors/loggingInterceptor.ts:14
Parameters:
▪ __namedParameters: object
Name
Type
logger
function
Returns: HttpInterceptorFunction
Const
createRedirectionInterceptor▸ createRedirectionInterceptor(__namedParameters
: object): HttpInterceptorFunction
Defined in packages/http/src/interceptors/redirectionInterceptor.ts:8
Parameters:
▪Default value
__namedParameters: object= {}
Name
Type
Default
redirectionLimit
number
30
Returns: HttpInterceptorFunction
Const
createSimpleServer▸ createSimpleServer(__namedParameters
: object): SimpleServer
Defined in packages/http/src/testing/createSimpleServer.helper.ts:26
Parameters:
▪ __namedParameters: object
Name
Type
endpoints
headers
OutgoingHttpHeaders
status
number
Returns: SimpleServer
Const
deepKeyMap▸ deepKeyMap(object
: any, mapper
: function): any
Defined in packages/http/src/helpers/caseConversion.helper.ts:15
Parameters:
▪ object: any
▪ mapper: function
▸ (key
: string): string
Parameters:
Name
Type
key
string
Returns: any
Const
defaultHeaders▸ defaultHeaders(_host
: string): object
Defined in packages/http/src/helpers/httpClient.helper.ts:4
Parameters:
Name
Type
Default
_host
string
""
Returns: object
Accept: string = "application/json,application/vnd.api+json"
Content-Type: ContentType = ContentType.JSON
Const
encodeArrayBuffer▸ encodeArrayBuffer(data
: TypedArray | string | undefined, encoding
: BufferEncoding): Uint8Array‹›
Defined in packages/http/src/helpers/encoder.helper.ts:31
Parameters:
Name
Type
Default
data
""
encoding
"utf8"
Returns: Uint8Array‹›
Const
encodeText▸ encodeText(buffer
: ArrayBuffer, encoding
: string): string
Defined in packages/http/src/helpers/encoder.helper.ts:36
Parameters:
Name
Type
Default
buffer
ArrayBuffer
-
encoding
string
"utf8"
Returns: string
Const
fetchRequestHandler▸ fetchRequestHandler(fetchRequestHandlerOptions
: FetchRequestHandlerOptions): HttpRequestHandler
Defined in packages/http/src/requestHandlers/fetch.requestHandler.ts:17
Creates a new HttpRequestHandler that uses Fetch API underneath. Does not support timeout property. Abort is possible only after headers were received.
Parameters:
Name
Type
Default
Description
fetchRequestHandlerOptions
{}
default Fetch API options attached to all requests
Returns: HttpRequestHandler
Const
getCaseConverter▸ getCaseConverter(bodyCasing?
: BodyCasing): toCamelCase
Defined in packages/http/src/helpers/caseConversion.helper.ts:51
Parameters:
Name
Type
bodyCasing?
Returns: toCamelCase
Const
getEncodingFromHeaders▸ getEncodingFromHeaders(headers
: HttpResponseHeaders | undefined, fallback
: string): string
Defined in packages/http/src/helpers/encoder.helper.ts:23
Parameters:
Name
Type
Default
headers
-
fallback
string
"utf8"
Returns: string
Const
getHeader▸ getHeader(headers
: HttpHeaders | undefined, header
: string): string | undefined
Defined in packages/http/src/helpers/headers.helper.ts:3
Parameters:
Name
Type
headers
header
string
Returns: string | undefined
Const
getHostname▸ getHostname(url
: string): string
Defined in packages/http/src/helpers/httpClient.helper.ts:29
Parameters:
Name
Type
url
string
Returns: string
Const
handleRequest▸ handleRequest(code
: number, body
: any, contentType
: string): Promise‹HttpResponse›
Defined in packages/http/src/requestHandlers/mock.requestHandler.ts:8
Parameters:
Name
Type
Default
code
number
-
body
any
-
contentType
string
ContentType.TEXT
Returns: Promise‹HttpResponse›
Const
httpRequestHandler▸ httpRequestHandler(requestHandlerOptions
: HttpRequestHandlerOptions): HttpRequestHandler
Defined in packages/http/src/requestHandlers/http.requestHandler.ts:19
Creates a new HttpRequestHandler that uses native Node.js HTTP & HTTPS modules underneath. Does not support mode property.
Parameters:
Name
Type
Default
Description
requestHandlerOptions
{}
default native options attached to all requests
Returns: HttpRequestHandler
Const
isHttpInterceptorInterface▸ isHttpInterceptorInterface(interceptor
: HttpInterceptor): interceptor is HttpInterceptorInterface
Defined in packages/http/src/httpClient.ts:89
Parameters:
Name
Type
interceptor
Returns: interceptor is HttpInterceptorInterface
Const
isHttpRequestError▸ isHttpRequestError(error
: any): error is HttpRequestError
Defined in packages/http/src/httpRequestError.ts:14
Parameters:
Name
Type
error
any
Returns: error is HttpRequestError
Const
isHttpResponseError▸ isHttpResponseError(error
: any): error is HttpResponseError
Defined in packages/http/src/httpResponseError.ts:17
Parameters:
Name
Type
error
any
Returns: error is HttpResponseError
Const
mergeRequestOptions▸ mergeRequestOptions(defaultRequestOptions
: RequestInit | undefined, requestOptions
: NormalizedHttpOptions): RequestInit & NormalizedHttpOptions
Defined in packages/http/src/requestHandlers/fetch.requestHandler.ts:62
Parameters:
Name
Type
defaultRequestOptions
RequestInit | undefined
requestOptions
Returns: RequestInit & NormalizedHttpOptions
Const
mockRequestHandler▸ mockRequestHandler(mockOptions
: MockOptions): MockHttpRequestHandler
Defined in packages/http/src/requestHandlers/mock.requestHandler.ts:40
Parameters:
Name
Type
mockOptions
Returns: MockHttpRequestHandler
Const
noConversion▸ noConversion(object
: any): any
Defined in packages/http/src/helpers/caseConversion.helper.ts:49
Parameters:
Name
Type
object
any
Returns: any
Const
parseHeaders▸ parseHeaders(headers
: Headers): Record‹string, string›
Defined in packages/http/src/helpers/headers.helper.ts:12
Parameters:
Name
Type
headers
Headers
Returns: Record‹string, string›
Const
passthroughParser▸ passthroughParser(response
: RawHttpResponse): object
Defined in packages/http/src/httpClient.ts:104
Parameters:
Name
Type
response
Returns: object
parsedBody: any = (response as any).parsedBody || (() => response.arrayBuffer())
Const
sanitizeHeaders▸ sanitizeHeaders(headers
: Record‹string, any›): Record‹string, string›
Defined in packages/http/src/helpers/httpClient.helper.ts:19
Parameters:
Name
Type
headers
Record‹string, any›
Returns: Record‹string, string›
Const
sleep▸ sleep(ms
: number): Promise‹unknown›
Defined in packages/http/src/helpers/sleep.helper.ts:1
Parameters:
Name
Type
ms
number
Returns: Promise‹unknown›
Const
splitWords▸ splitWords(text
: string): string[]
Defined in packages/http/src/helpers/caseConversion.helper.ts:11
Parameters:
Name
Type
text
string
Returns: string[]
▸ switchContentType<T>(contentType
: string, map
: ContentTypeMap‹T›, defaultResult
: T): T
Defined in packages/http/src/contentType.ts:16
Type parameters:
▪ T
Parameters:
Name
Type
contentType
string
map
defaultResult
T
Returns: T
▸ switchContentType<T>(contentType
: string, map
: ContentTypeMap‹T›): T | undefined
Defined in packages/http/src/contentType.ts:17
Type parameters:
▪ T
Parameters:
Name
Type
contentType
string
map
Returns: T | undefined
Const
toCamelCase▸ toCamelCase(object
: any): any
Defined in packages/http/src/helpers/caseConversion.helper.ts:31
Parameters:
Name
Type
object
any
Returns: any
Const
toKebabCase▸ toKebabCase(object
: any): any
Defined in packages/http/src/helpers/caseConversion.helper.ts:45
Parameters:
Name
Type
object
any
Returns: any
Const
toPascalCase▸ toPascalCase(object
: any): any
Defined in packages/http/src/helpers/caseConversion.helper.ts:37
Parameters:
Name
Type
object
any
Returns: any
Const
toSnakeCase▸ toSnakeCase(object
: any): any
Defined in packages/http/src/helpers/caseConversion.helper.ts:41
Parameters:
Name
Type
object
any
Returns: any
Const
toUrlEncoded▸ toUrlEncoded(obj
: object): string
Defined in packages/http/src/helpers/httpClient.helper.ts:9
Parameters:
Name
Type
obj
object
Returns: string
Const
urlCombine▸ urlCombine(sourceUrl
: string, sourceQuery?
: undefined | object, options?
: qs.IStringifyOptions): string
Defined in packages/http/src/helpers/urlEncoding.helper.ts:15
Parameters:
Name
Type
sourceUrl
string
sourceQuery?
undefined | object
options?
qs.IStringifyOptions
Returns: string
Const
urlDecode▸ urlDecode<T>(value
: string, options?
: qs.IParseOptions): T
Defined in packages/http/src/helpers/urlEncoding.helper.ts:28
Type parameters:
▪ T
Parameters:
Name
Type
value
string
options?
qs.IParseOptions
Returns: T
Const
urlDestruct▸ urlDestruct(url
: string, options?
: qs.IParseOptions): object
Defined in packages/http/src/helpers/urlEncoding.helper.ts:4
Parameters:
Name
Type
url
string
options?
qs.IParseOptions
Returns: object
query: any
url: string
Const
urlEncode▸ urlEncode(value
: any, options?
: qs.IStringifyOptions): string
Defined in packages/http/src/helpers/urlEncoding.helper.ts:24
Parameters:
Name
Type
value
any
options?
qs.IStringifyOptions
Returns: string
Const
useInterceptor▸ useInterceptor(normalizedOptions
: NormalizedHttpOptions): (Anonymous function)
Defined in packages/http/src/httpClient.ts:94
Parameters:
Name
Type
normalizedOptions
Returns: (Anonymous function)
Const
xhrRequestHandler▸ xhrRequestHandler(): HttpRequestHandler
Defined in packages/http/src/requestHandlers/xhr.requestHandler.ts:51
Returns: HttpRequestHandler
Const
ContentTypeRegexDefined in packages/http/src/contentType.ts:8
• JSON: RegExp‹› = /^application\/(json|.++json)$/
Defined in packages/http/src/contentType.ts:10
• TEXT: RegExp‹› = /^text\//
Defined in packages/http/src/contentType.ts:9
• URL_ENCODED: RegExp‹› = /^application\/x-www-form-urlencoded$/
Defined in packages/http/src/contentType.ts:11
Const
HttpClientHelperDefined in packages/http/src/helpers/httpClient.helper.ts:34
• defaultHeaders: defaultHeaders
Defined in packages/http/src/helpers/httpClient.helper.ts:35
• getHostname: getHostname
Defined in packages/http/src/helpers/httpClient.helper.ts:38
• sanitizeHeaders: sanitizeHeaders
Defined in packages/http/src/helpers/httpClient.helper.ts:37
• toUrlEncoded: toUrlEncoded
Defined in packages/http/src/helpers/httpClient.helper.ts:36
Const
HttpStatusTextDefined in packages/http/src/httpCodes.ts:52
• __computed: string = "Network Authentication Required"
Defined in packages/http/src/httpCodes.ts:53
Defined in packages/http/src/httpCodes.ts:54
Defined in packages/http/src/httpCodes.ts:55
Defined in packages/http/src/httpCodes.ts:56
Defined in packages/http/src/httpCodes.ts:57
Defined in packages/http/src/httpCodes.ts:58
Defined in packages/http/src/httpCodes.ts:59
Defined in packages/http/src/httpCodes.ts:60
Defined in packages/http/src/httpCodes.ts:61
Defined in packages/http/src/httpCodes.ts:62
Defined in packages/http/src/httpCodes.ts:63
Defined in packages/http/src/httpCodes.ts:64
Defined in packages/http/src/httpCodes.ts:65
Defined in packages/http/src/httpCodes.ts:66
Defined in packages/http/src/httpCodes.ts:67
Defined in packages/http/src/httpCodes.ts:68
Defined in packages/http/src/httpCodes.ts:69
Defined in packages/http/src/httpCodes.ts:70
Defined in packages/http/src/httpCodes.ts:71
Defined in packages/http/src/httpCodes.ts:72
Defined in packages/http/src/httpCodes.ts:73
Defined in packages/http/src/httpCodes.ts:74
Defined in packages/http/src/httpCodes.ts:75
Defined in packages/http/src/httpCodes.ts:76
Defined in packages/http/src/httpCodes.ts:77
Defined in packages/http/src/httpCodes.ts:78
Defined in packages/http/src/httpCodes.ts:79
Defined in packages/http/src/httpCodes.ts:80
Defined in packages/http/src/httpCodes.ts:81
Defined in packages/http/src/httpCodes.ts:82
Defined in packages/http/src/httpCodes.ts:83
Defined in packages/http/src/httpCodes.ts:84
Defined in packages/http/src/httpCodes.ts:85
Defined in packages/http/src/httpCodes.ts:86
Defined in packages/http/src/httpCodes.ts:87
Defined in packages/http/src/httpCodes.ts:88
Defined in packages/http/src/httpCodes.ts:89
Defined in packages/http/src/httpCodes.ts:90
Defined in packages/http/src/httpCodes.ts:91
Defined in packages/http/src/httpCodes.ts:92
Defined in packages/http/src/httpCodes.ts:93
Defined in packages/http/src/httpCodes.ts:94
Defined in packages/http/src/httpCodes.ts:95
Defined in packages/http/src/httpCodes.ts:96
Defined in packages/http/src/httpCodes.ts:97
Defined in packages/http/src/httpCodes.ts:98
Defined in packages/http/src/httpCodes.ts:99
Defined in packages/http/src/httpCodes.ts:100
Const
InterceptorsDefined in packages/http/src/interceptors/index.ts:5
• createErrorInterceptor: createErrorInterceptor
Defined in packages/http/src/interceptors/index.ts:6
• createLoggingInterceptor: createLoggingInterceptor
Defined in packages/http/src/interceptors/index.ts:7
• createRedirectionInterceptor: createRedirectionInterceptor
Defined in packages/http/src/interceptors/index.ts:8
LoggingInterceptorOptions
• logger: function
Defined in packages/http/src/interceptors/loggingInterceptor.ts:11
▸ (log
: Log): void
Parameters:
Name
Type
log
RawHttpResponse
↳
• ok: boolean
• redirected: boolean
• status: number
• statusText: string
• url: string
▸ abort(): void
Returns: void
▸ arrayBuffer(): Promise‹ArrayBuffer›
Returns: Promise‹ArrayBuffer›
▸ text(): Promise‹string›
Returns: Promise‹string›
‹Body›
undefined | | | |
undefined | | | |
‹T›
[]
| string | undefined
| undefined
| undefined
‹T›
‹T›
Defined in
Defined in
Defined in
• headers:
Defined in
Defined in
Defined in
Defined in
Defined in
Defined in
Defined in
Defined in
Defined in
Defined in
Defined in
• body? :
Defined in
Defined in
Defined in
• method:
Defined in
• mode? :
Defined in
Defined in
Defined in
Defined in