Http
Http request object. Expose chainable API
Constructor Summary
Public Constructor | ||
public |
constructor(params: *) |
Member Summary
Public Members | ||
public |
internals: * |
Method Summary
Public Methods | ||
public |
Adds body to request model |
|
public |
bodyProcessor(bodyProcessor: func): Object Sets the function which gets the body object as a parameter |
|
public |
Executes HTTP request |
|
public |
Adds header to request model |
|
public |
Adds HTTP method information to request model |
|
public |
Adds query string param |
|
public |
responseType(responseType: String): Object Sets response content type |
|
public |
Adds dynamic segment value |
|
public |
Adds URL information to HTTP request model |
|
public |
this method was deprecated. since version 0.2.0
Adds body to request model |
|
public |
withBodyProccessor(bodyProcessor: func): Object this method was deprecated. since version 0.2.0
Sets the function which gets the body object as a parameter |
|
public |
withDynamicSegment(segment: String, value: String): Object this method was deprecated. since version 0.2.0
Adds dynamic segment value |
|
public |
withHeader(header: String, value: String): Object this method was deprecated. since version 0.2.0
Adds header to request model |
|
public |
this method was deprecated. since version 0.2.0
Predifine body sringification and Content-Type attribute. |
|
public |
this method was deprecated. since version 0.2.0
Sets response type to 'json' |
|
public |
withMethod(method: string): Object this method was deprecated. since version 0.2.0
Adds HTTP method information to request model |
|
public |
this method was deprecated. since version 0.2.0
Adds query string param |
|
public |
withResponseType(responseType: String): Object this method was deprecated. since version 0.2.0
Sets response content type |
|
public |
this method was deprecated. since version 0.2.0
Adds URL information to HTTP request model |
Public Constructors
public constructor(params: *) source
Params:
Name | Type | Attribute | Description |
params | * |
|
Public Members
public internals: * source
Public Methods
public body(body: Object): Object source
Adds body to request model
Params:
Name | Type | Attribute | Description |
body | Object | request payload |
public bodyProcessor(bodyProcessor: func): Object source
Sets the function which gets the body object as a parameter which result would be used as a request body
Params:
Name | Type | Attribute | Description |
bodyProcessor | func | f(x) => valid_http_body |
public method(method: string): Object source
Adds HTTP method information to request model
Params:
Name | Type | Attribute | Description |
method | string | HTTP method |
public responseType(responseType: String): Object source
Sets response content type Proper values could be obtained form XmlHttpRequest specification https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest#Properties
Params:
Name | Type | Attribute | Description |
responseType | String | Proper values could be obtained form XmlHttpRequest specification https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest#Properties |
public url(url: string): Object source
Adds URL information to HTTP request model
Params:
Name | Type | Attribute | Description |
url | string | URL |
public withBody(body: Object): Object source
Adds body to request model
Params:
Name | Type | Attribute | Description |
body | Object | request payload |
public withBodyProccessor(bodyProcessor: func): Object source
Sets the function which gets the body object as a parameter which result would be used as a request body
Params:
Name | Type | Attribute | Description |
bodyProcessor | func | f(x) => valid_http_body |
public withDynamicSegment(segment: String, value: String): Object source
Adds dynamic segment value
public withHeader(header: String, value: String): Object source
Adds header to request model
public withJsonBody(): Object source
Predifine body sringification and Content-Type attribute.
public withJsonResponse(): Object source
Sets response type to 'json'
public withMethod(method: string): Object source
Adds HTTP method information to request model
Params:
Name | Type | Attribute | Description |
method | string | HTTP method |
public withParam(name: String, value: String): Object source
Adds query string param
public withResponseType(responseType: String): Object source
Sets response content type Proper values could be obtained form XmlHttpRequest specification https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest#Properties
Params:
Name | Type | Attribute | Description |
responseType | String | Proper values could be obtained form XmlHttpRequest specification https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest#Properties |