docs: improved docs

This commit is contained in:
Morten Olsen
2025-05-18 21:18:05 +02:00
parent ad342e5f10
commit 6b74a28989
5 changed files with 31 additions and 23 deletions

View File

@@ -10,6 +10,7 @@ type Response = {
statusText: string;
headers: Record<string, string>;
body?: string;
rawBody?: string;
};
type AddRequestOptios = {

View File

@@ -59,7 +59,8 @@ const httpHandler: ExecutionHandler = ({
body
});
let responseText = await response.text();
const rawBody = await response.text();
let responseText = rawBody;
if (options.json) {
try {
responseText = JSON.parse(responseText);
@@ -84,6 +85,7 @@ const httpHandler: ExecutionHandler = ({
statusText: response.statusText,
headers: Object.fromEntries(response.headers.entries()),
body: responseText,
rawBody: rawBody,
},
});
},