Parameter | Type | Description |
---|---|---|
method | string | Request method (e.g. POST). Note, the method must be uppercase. |
url | string / HTTP URL | Request URL (e.g. http://example.com). |
body (optional) | string / object / ArrayBuffer | Request body; objects will be x-www-form-urlencoded. |
params (optional) | object | Params object containing additional request parameters. |
Returns
Type | Description |
---|---|
Response | HTTP Response object. |
Example
Using http.request() to issue a POST request: