Namespace: http

gpf. http

Root namespace for http specifics

Since:
  • 0.2.1

Members


<static, readonly> methods :enum

HTTP methods enumeration

Type:
  • enum
Properties:
Name Type Description
get enum

GET

post enum

POST

put enum

PUT

options enum

OPTIONS

delete enum

DELETE

head enum

HEAD

Since:
  • 0.2.1

Methods


<static> delete(urlOrRequest)

HTTP DELETE request

Parameters:
Name Type Description
urlOrRequest String | gpf.typedef.httpRequestSettings

URL or HTTP Request settings

Since:
  • 0.2.1
Returns:

Resolved on request completion

Type
Promise.<gpf.typedef.httpRequestResponse>

<static> get(urlOrRequest)

HTTP GET request

Parameters:
Name Type Description
urlOrRequest String | gpf.typedef.httpRequestSettings

URL or HTTP Request settings

Since:
  • 0.2.1
Returns:

Resolved on request completion

Type
Promise.<gpf.typedef.httpRequestResponse>

<static> head(urlOrRequest)

HTTP HEAD request

Parameters:
Name Type Description
urlOrRequest String | gpf.typedef.httpRequestSettings

URL or HTTP Request settings

Since:
  • 0.2.2
Returns:

Resolved on request completion

Type
Promise.<gpf.typedef.httpRequestResponse>

<static> mock(definition)

Add a mocked request

Parameters:
Name Type Description
definition gpf.typedef.mockedRequest

Mocked request definition

Since:
  • 0.2.2
Returns:

Mocked request identifier, to be used with gpf.http.mock.remove

Type
gpf.typedef.mockedRequestID

<static> options(urlOrRequest)

HTTP OPTIONS request

Parameters:
Name Type Description
urlOrRequest String | gpf.typedef.httpRequestSettings

URL or HTTP Request settings

Since:
  • 0.2.1
Returns:

Resolved on request completion

Type
Promise.<gpf.typedef.httpRequestResponse>

<static> post(urlOrRequest, data)

HTTP POST request

Parameters:
Name Type Description
urlOrRequest String | gpf.typedef.httpRequestSettings

URL or HTTP Request settings

data String

Data to POST

Since:
  • 0.2.1
Returns:

Resolved on request completion

Type
Promise.<gpf.typedef.httpRequestResponse>

<static> put(urlOrRequest, data)

HTTP PUT request

Parameters:
Name Type Description
urlOrRequest String | gpf.typedef.httpRequestSettings

URL or HTTP Request settings

data String

Data to PUT

Since:
  • 0.2.1
Returns:

Resolved on request completion

Type
Promise.<gpf.typedef.httpRequestResponse>

<static> request(request)

HTTP request common implementation

Parameters:
Name Type Description
request gpf.typedef.httpRequestSettings

HTTP Request settings

Since:
  • 0.2.1
Returns:

Resolved on request completion

Type
Promise.<gpf.typedef.httpRequestResponse>