Slide 39
Slide 39 text
The Response
object constructor
accepts many types
of data, including
Blobs,
ArrayBuffers,
FormData objects,
and strings.
39
const request = new Request('/images/sample1.jpg');
const imageBlob = new Blob([data], {type: 'image/jpeg'});
const imageResponse = new Response(imageBlob);
const stringResponse = new Response('Hello world');