new Transport(options, encodeUri)
Parameters:
| Name | Type | Argument | Description |
|---|---|---|---|
options |
TransportDefaults |
<nullable> |
The options to use with all fetch requests |
encodeUri |
string |
<nullable> |
Indicate whether to encode request URIs generated. Defaults |
- Source:
Properties:
| Name | Type | Argument | Description |
|---|---|---|---|
defaults |
TransportDefaults |
<nullable> |
Stored from the initial 'options' parameter merged with the standard defaults |
Example
import Transport from '@pikselpalette/sequoia-js-client-sdk/lib/transport';
const transport = new Transport({method: 'POST'});
transport.fetchWithDefaults('someurl').then((response) => console.log(response);
Methods
-
destroy(url, options)
-
Performs an HTTP DELETE request
Parameters:
Name Type Description urlstring sequoia url
optionsobject - Source:
Returns:
- Type
- Promise
-
encodeUrl(url)
-
Encodes the request url if
this.encodeUriis true.Parameters:
Name Type Description urlstring the url to potentially encode
- Source:
-
fetchWithDefaults(url, options)
-
Parameters:
Name Type Description urlstring sequoia url
optionsobject - Source:
Returns:
- Type
- Promise
-
get(url, options)
-
Performs an HTTP GET request
Parameters:
Name Type Description urlstring sequoia url
optionsobject - Source:
Returns:
- Type
- Promise
-
post(url, options)
-
Performs an HTTP POST request
Parameters:
Name Type Description urlstring sequoia url
optionsobject - Source:
Returns:
- Type
- Promise
-
put(url, options)
-
Performs an HTTP PUT request
Parameters:
Name Type Description urlstring sequoia url
optionsobject - Source:
Returns:
- Type
- Promise
Javascript Client SDK