# new Reket(config)
Parameters:
Name | Type | Description |
---|---|---|
config |
ReketConfig | Object | An instance of ReketConfig instance or an object with the options for creating a ReketConfig instance. |
- See:
-
- ReketConfig constructor for available options in case of `config` parameter is an Object.
Members
Methods
# delete(urlOrReketRequest, optionsopt) → {Promise}
Send a DELETE request.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
urlOrReketRequest |
string | ReketRequest | An url where to DELETE or an instance of ReketRequest that will be passed to request method. |
||
options |
Object |
<optional> |
{} | Options for creating an instance of ReketRequest in case of urlOrReketRequest parameter is a string. |
Promise returned by request method.
# get(urlOrReketRequest, optionsopt) → {Promise}
Send a GET request.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
urlOrReketRequest |
string | ReketRequest | An url to GET or an instance of ReketRequest that will be passed to request method. |
||
options |
Object |
<optional> |
{} | Options for creating an instance of ReketRequest in case of urlOrReketRequest parameter is a string. |
Promise returned by request method.
# post(urlOrReketRequest, dataopt, optionsopt) → {Promise}
Send a POST request.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
urlOrReketRequest |
string | ReketRequest | An url where to POST or an instance of ReketRequest that will be passed to request method. |
||
data |
Object |
<optional> |
{} | Data to be sent as the request message data. |
options |
Object |
<optional> |
{} | Options for creating an instance of ReketRequest in case of urlOrReketRequest parameter is a string. |
Promise returned by request method.
# put(urlOrReketRequest, dataopt, optionsopt) → {Promise}
Send a PUT request.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
urlOrReketRequest |
string | ReketRequest | An url where to PUT or an instance of ReketRequest that will be passed to request method. |
||
data |
Object |
<optional> |
{} | Data to be sent as the request message data. |
options |
Object |
<optional> |
{} | Options for creating an instance of ReketRequest in case of urlOrReketRequest parameter is a string. |
Promise returned by request method.
# request(reketRequest) → {Promise}
Send an HTTP request with the configured client.
Parameters:
Name | Type | Description |
---|---|---|
reketRequest |
ReketRequest | An instance of ReketRequest as options. |
That returns an instance of ReketResponse in case of success, an instance ReketError in case of error.