ol-ishare/http

Methods

(inner) appendParams(uri, paramsnon-null) → {String}

Appends query parameters to a URI.

Parameters:
Name Type Description
uri String

The original URI, which may already have query data.

params Object

An object where keys are URI-encoded parameter keys, and the values are arbitrary types or arrays.

Returns:

The new URI.

Type
String

(package, inner) checkHttpStatusIsOk(response) → {Response}

Checks HTTP status of fetch response, if OK return response else throw an Error with details

Parameters:
Name Type Description
response Response

Response instance returned by fetch

Throws:

Error instance with address (URL), errno (HTTP status) and info (HTTP status text)

Type
Error
Returns:

Response instance with OK HTTP status

Type
Response