Request options to pass to httpFetch.
httpFetch
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); Copy
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);
Body encoded in bytes to send along in a POST, PATCH, etc.
Headers to send along. Key -> Value ex: headers.set('Content-Type', 'application/json')
HTTP method: "GET", "POST", "PATCH", etc.
Request options to pass to
httpFetch
.Example