Constructor
new HttpRequestBuilder()
Does default initialization of the configuration.
- Source:
Methods
addAcceptHeader(value) → {HttpRequestBuilder}
Add a specific header of type Accept
with the given value.
Parameters:
Name | Type | Description |
---|---|---|
value |
string |
- Source:
Returns:
- Type
- HttpRequestBuilder
addAuthorizationHeader(value) → {HttpRequestBuilder}
Add an Authorization header which holds an authorization token.
Parameters:
Name | Type | Description |
---|---|---|
value |
string |
- Source:
Returns:
- Type
- HttpRequestBuilder
addContentTypeHeader(value) → {HttpRequestBuilder}
Add a specific header of type Content-Type
with the given
value.
Parameters:
Name | Type | Description |
---|---|---|
value |
string |
- Source:
Returns:
- Type
- HttpRequestBuilder
addGraphDBPasswordHeader(value) → {HttpRequestBuilder}
Add a custom GraphDB header which holds a user password for base authentication.
Parameters:
Name | Type | Description |
---|---|---|
value |
string |
- Source:
Returns:
- Type
- HttpRequestBuilder
addHeader(header, value) → {HttpRequestBuilder}
Add a new http header entry. Blank values are skipped.
Parameters:
Name | Type | Description |
---|---|---|
header |
string | type |
value |
string | the header value |
- Source:
Returns:
- Type
- HttpRequestBuilder
addParam(param, value) → {HttpRequestBuilder}
Add a new request param.
Parameters:
Name | Type | Description |
---|---|---|
param |
string | |
value |
* |
- Source:
Returns:
- Type
- HttpRequestBuilder
get() → {Object}
Getter for the configuration.
- Source:
Returns:
- Type
- Object
getData() → {*}
Gets the data to be sent as payload.
- Source:
Returns:
- Type
- *
getHeaders() → {Object.<string, string>}
Returns the headers map.
- Source:
Returns:
- Type
- Object.<string, string>
getMethod() → {string}
Gets the HTTP method.
- Source:
Returns:
- Type
- string
getParams() → {Object.<string, *>}
Returns the request parameters map.
- Source:
Returns:
- Type
- Object.<string, *>
getResponseType() → {string}
Returns the request's response type.
- Source:
Returns:
- Type
- string
getTimeout() → {number}
Returns the request timeout.
- Source:
Returns:
- Type
- number
getUrl() → {string}
Gets the URL.
- Source:
Returns:
- Type
- string
setData(data) → {HttpRequestBuilder}
Sets the data to be sent as request payload.
Parameters:
Name | Type | Description |
---|---|---|
data |
* | the payload |
- Source:
Returns:
- Type
- HttpRequestBuilder
setHeaders(headers) → {HttpRequestBuilder}
Sets the headers map.
Parameters:
Name | Type | Description |
---|---|---|
headers |
Object.<string, string> | the headers map |
- Source:
Returns:
- Type
- HttpRequestBuilder
setMethod(method) → {HttpRequestBuilder}
Sets the HTTP method.
Parameters:
Name | Type | Description |
---|---|---|
method |
string |
- Source:
Returns:
- Type
- HttpRequestBuilder
setParams(params) → {HttpRequestBuilder}
Set request parameters object.
Parameters:
Name | Type | Description |
---|---|---|
params |
Object |
- Source:
Returns:
- Type
- HttpRequestBuilder
setResponseType(responseType) → {HttpRequestBuilder}
Set a responseType config.
Parameters:
Name | Type | Description |
---|---|---|
responseType |
string |
- Source:
Returns:
- Type
- HttpRequestBuilder
setTimeout(timeout) → {HttpRequestBuilder}
Set timeout configuration.
Parameters:
Name | Type | Description |
---|---|---|
timeout |
number | in ms |
- Source:
Returns:
- Type
- HttpRequestBuilder
setUrl(url) → {HttpRequestBuilder}
Sets the URL against which to perform the request.
Parameters:
Name | Type | Description |
---|---|---|
url |
string |
- Source:
Returns:
- Type
- HttpRequestBuilder
(static) httpDelete(url) → {HttpRequestBuilder}
Prepares new builder for HTTP DELETE request against the provided URL.
Parameters:
Name | Type | Description |
---|---|---|
url |
string |
- Source:
Returns:
- Type
- HttpRequestBuilder
(static) httpGet(url) → {HttpRequestBuilder}
Prepares new builder for HTTP GET request against the provided URL.
Parameters:
Name | Type | Description |
---|---|---|
url |
string |
- Source:
Returns:
- Type
- HttpRequestBuilder
(static) httpPatch(url) → {HttpRequestBuilder}
Prepares new builder for HTTP PATCH request against the provided URL.
Parameters:
Name | Type | Description |
---|---|---|
url |
string |
- Source:
Returns:
- Type
- HttpRequestBuilder
(static) httpPost(url) → {HttpRequestBuilder}
Prepares new builder for HTTP POST request against the provided URL.
Parameters:
Name | Type | Description |
---|---|---|
url |
string |
- Source:
Returns:
- Type
- HttpRequestBuilder
(static) httpPut(url) → {HttpRequestBuilder}
Prepares new builder for HTTP PUT request against the provided URL.
Parameters:
Name | Type | Description |
---|---|---|
url |
string |
- Source:
Returns:
- Type
- HttpRequestBuilder