1 Commits

Author SHA1 Message Date
Morten Olsen
6ce6eeeedb docs: improved docs 2025-05-18 21:18:09 +02:00
4 changed files with 5 additions and 8 deletions

View File

@@ -213,12 +213,12 @@ Assume `_shared_requests.md` contains:
Then, in `main.md`:
::raw-md[./examples/with-shared-requests.md]
::raw-md[./examples/with-template.md]
<details>
<summary>Output</summary>
::raw-md[./examples/with-shared-requests.md]{render}
::raw-md[./examples/with-template.md]{render}
</details>

View File

@@ -4,7 +4,7 @@ Let's include some shared requests:
::md[./_shared_requests.md]
The shared GET request returned: {{response.statusText}}
The shared GET request returned:
Now, a request specific to this document:
@@ -12,7 +12,7 @@ Now, a request specific to this document:
POST https://httpbin.org/post
Content-Type: application/json
{"dataFromMain": "someValue", "sharedUrl": "{{requests.sharedGetRequest.url}}"}
{"dataFromMain": "someValue", "sharedUrl": ""}
```
::response

View File

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

View File

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