Request options to pass to httpFetch.

Example

const headers = new Map<string, string>();
headers.set('x-header', 'example');

const options = new HttpFetchOptions();
options.method = "Post";
options.headers = headers;
options.body = Bytes.fromUtf8String('{"value":"test"}');

const response = httpFetch("https://swapi.dev/api/planets/1/", options);

Constructors

Properties

Constructors

Properties

body: null | Bytes = null

Body encoded in bytes to send along in a POST, PATCH, etc.

headers: Map<string, string> = ...

Headers to send along. Key -> Value ex: headers.set('Content-Type', 'application/json')

method: string = "Get"

HTTP method: "GET", "POST", "PATCH", etc.