Methods
The following methods return either a Response object, or a Promise object that will eventually resolve to a Response object, if asynchronous. Asynchronous means that the method will be called, but will not block script execution - so multiple asynchronous calls to network services can be made in succession, without each call "waiting" for the result of the previous. Parameters for these functions are documented below.
Method | Description | Return type |
---|
.get() | Sends an HTTP GET call, blocking for a response. | Response |
.getAsync() | Sends an HTTP GET call without blocking. | Promise |
.post() | Sends an HTTP POST call, blocking for a response. | Response |
.postAsync() | Sends an HTTP POST call without blocking. | Promise |
.put() | Sends an HTTP PUT call, blocking for a response. | Response |
.putAsync() | Sends an HTTP PUT call without blocking. | Promise |
.delete() | Sends an HTTP DELETE call, blocking for a response. | Response |
.deleteAsync() | Sends an HTTP DELETE call without blocking. | Promise |
.patch() | Sends an HTTP PATCH call, blocking for a response. | Response |
.patchAsync() | Sends an HTTP PATCH call without blocking. | Promise |
.head() | Sends an HTTP HEAD call, blocking for a response. | Response |
.headAsync() | Sends an HTTP HEAD call without blocking. | Promise |
.options() | Sends an HTTP OPTIONS call, blocking for a response. | Response |
.optionsAsync() | Sends an HTTP OPTIONS call without blocking. | Promise |
.trace() | Sends an HTTP TRACE call, blocking for a response. | Response |
.traceAsync() | Sends an HTTP TRACE call, without blocking for a response. | Promise |
.request() | Sends an HTTP request, using a verb specified by the method parameter. Use this method in cases where a non-standard verb is required, and you need the call to block. | Response |
.requestAsync() | Sends an HTTP request, with a verb specified by the method parameter. Use this method in cases where a non-standard verb is required, and you do not want the call to block. | Promise |
Parameters
Parameters in this section can be used by any of the methods above. Exceptions to this rule will be defined on each parameter.