Client
HTTP client used by the Super-Siren library. Library utilized superaget for all requests.
Static Member Summary
Static Public Members | ||
public static get |
globalHeaders: Immutable.Map: * Returns a Map of current global headers that are added |
Static Method Summary
Static Public Methods | ||
public static |
action(method: *, href: *): * |
|
public static |
Registers a global header to be used by all client instances. |
|
public static |
Registers a content type parser with all client instances. |
|
public static |
del(href: *): * |
|
public static |
Creates a superagent HTTP get operation |
|
public static |
post(href: *): * |
|
public static |
put(href: *): * |
|
public static |
removeHeader(header: String): undefined Remves a previously registered global header. |
Static Public Members
public static get globalHeaders: Immutable.Map: * source
Returns a Map of current global headers that are added for all clients.
Return:
Immutable.Map | Immutable map of all currently registered headers |
Static Public Methods
public static action(method: *, href: *): * source
Params:
Name | Type | Attribute | Description |
method | * | ||
href | * |
Return:
* |
public static addHeader(header: String, value: String): undefined source
Registers a global header to be used by all client instances.
public static addParser(contentType: String, parseFunction: Function): undefined source
Registers a content type parser with all client instances.
Params:
Name | Type | Attribute | Description |
contentType | String | content-type which should be parsed with the provided function whenever a response is received with this content type. |
|
parseFunction | Function | Function to call in order to return response body when response is encoded with the provided contentType. |