Constructor
# new ReketRequest(urlopt, options)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
url |
string |
<optional> |
Absolute or relative URL of the resource that is being requested. |
options |
Object | The options of the request object to create. Refer to your client lib for available options. Some of the options are abstracted by this class to have something generic. |
|
method |
string |
<optional> |
HTTP method (e.g. 'GET', 'POST', etc). |
headers |
Object |
<optional> |
Map of strings representing HTTP headers to send to the server. |
Members
Methods
# addHeader(name, value)
Add a header to be send.
Parameters:
Name | Type | Description |
---|---|---|
name |
string | The name of the header to add |
value |
string | The value of the header. |
this
# setData(requestData)
Set the data to be sent as the request message data.
Parameters:
Name | Type | Description |
---|---|---|
requestData |
object | The data to send in request message data. |
this
# setMethod(requestMethod)
Set the HTTP method used by the request.
Parameters:
Name | Type | Description |
---|---|---|
requestMethod |
string | The HTTP method (e.g. 'GET', 'POST', etc). |
this