mirror of
https://github.com/morten-olsen/http.md.git
synced 2026-02-08 00:46:28 +01:00
fix: align yaml option with documentation
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
First, create a resource:
|
First, create a resource:
|
||||||
|
|
||||||
```http #createUser,format=yaml
|
```http #createUser,yaml,json
|
||||||
POST https://httpbin.org/post
|
POST https://httpbin.org/post
|
||||||
Content-Type: application/json
|
Content-Type: application/json
|
||||||
|
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ const httpHandler: ExecutionHandler = ({
|
|||||||
);
|
);
|
||||||
|
|
||||||
let parsedBody = body;
|
let parsedBody = body;
|
||||||
if (options.format === 'yaml') {
|
if (options.yaml) {
|
||||||
try {
|
try {
|
||||||
const parsed = YAML.parse(body);
|
const parsed = YAML.parse(body);
|
||||||
parsedBody = JSON.stringify(parsed);
|
parsedBody = JSON.stringify(parsed);
|
||||||
|
|||||||
Reference in New Issue
Block a user