Response types
Handling JSON Response
async function fetchJson(url: string) {
const response = await http.fetch(URL);
if (response.ok) {
return await response.json();
} else {
// Handle errors
}
}Handling Blob (Binary Data)
async function fetchBlob(URL: string) {
const response = await http.fetch(URL);
if (response.ok) {
return await response.blob();
} else {
// Handle errors
}
}Response Transformation and Mapping
Last updated
Was this helpful?