Optional headersAdditional HTTP headers to include in the request
const headers = {
'Authorization': 'Bearer token123',
'Accept-Language': 'en-US'
};
Optional paramsQuery parameters to append to the URL
Parameters will be URL-encoded and appended to the request URL.
// Results in: my_addon/users?active=true&role=admin&role=user
const params = {
active: 'true',
role: ['admin', 'user']
};
Optional responseExpected response data type. Defaults to 'json'
json: Parse response as JSON (default)text: Get response as plain text stringblob: Get response as binary Blob (for file downloads)arraybuffer: Get response as ArrayBuffer (for binary data processing)// Download PDF file
const pdfBlob = await http.get('my_addon/report.pdf', {
responseType: 'blob'
});
Configuration options for HTTP requests
Example