From 28b4a57601c9fe4d5ca05953150192e6f7544b4f Mon Sep 17 00:00:00 2001 From: Artem Zakharchenko Date: Wed, 28 Aug 2024 18:32:57 +0200 Subject: [PATCH] Add `HttpResponse.html()` docs --- websites/mswjs.io/src/content/docs/api/http-response.mdx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/websites/mswjs.io/src/content/docs/api/http-response.mdx b/websites/mswjs.io/src/content/docs/api/http-response.mdx index 2b5d88e5..d7982c25 100644 --- a/websites/mswjs.io/src/content/docs/api/http-response.mdx +++ b/websites/mswjs.io/src/content/docs/api/http-response.mdx @@ -116,6 +116,14 @@ Creates a `Response` instance with the `Content-Type: text/plain` header and giv HttpResponse.text('Hello world!') ``` +### `HttpResponse.html(body, init)` + +Creates a `Response` instance with the `Content-Type: text/html` header and given response body. + +```js +HttpResponse.html(`

Hello world!

`) +``` + ### `HttpResponse.xml(body, init)` Creates a `Response` instance with the `Content-Type: application/xml` header and given response body.