HttpResponseType
Index
Properties
publicreadonlyarrayBuffer
Type declaration
Converts an array buffer Response to TypedResponse
<ArrayBuffer>.Parameters
r: Response
Returns TypedResponse<ArrayBuffer>
publicreadonlyblob
Type declaration
Converts a blob Response to TypedResponse
<Blob>.Parameters
r: Response
Returns TypedResponse<Blob>
publicreadonlyempty
Type declaration
Converts an empty Response to TypedResponse
<undefined>.Parameters
r: Response
Returns TypedResponse<undefined>
publicreadonlyjson
Type declaration
Converts a JSON Response to TypedResponse.
Type parameters
- T
Parameters
r: Response
Returns TypedResponse<T>
publicreadonlytext
Type declaration
Converts a text Response to TypedResponse
<string>.Parameters
r: Response
Returns TypedResponse<string>
publicstaticreadonlydefault
By default, value conversion methods only assign value when Response.status === 200
Methods
publicstaticarrayBuffer
Converts an array buffer Response to TypedResponse
<ArrayBuffer>.Parameters
r: Response
Returns TypedResponse<ArrayBuffer>
publicstaticblob
Converts a blob Response to TypedResponse
<Blob>.Parameters
r: Response
Returns TypedResponse<Blob>
publicstaticjson
Converts a JSON Response to TypedResponse.
Type parameters
- T
Parameters
r: Response
Returns TypedResponse<T>
publicstaticstatus
Default is that value is only valid if Response.status ===
200
for responses sent into arrayBuffer, json, text and blob. Call this method to create a custom HttpResponseType where value can be assigned for other status values as well. Example: A conflict response may still contain data which should be assigned to value.Parameters
statuses: number[]
Returns HttpResponseType
publicstatictext
Converts a text Response to TypedResponse
<string>.Parameters
r: Response
Returns TypedResponse<string>
Used with get to convert responses to correct data. See get for an example.