This commit is contained in:
Morten Olsen
2025-05-18 18:43:30 +02:00
commit db59fee6b1
26 changed files with 5001 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
# My API Document
Let's make a POST request to httpbin.org.
```http
POST https://httpbin.org/post
Content-Type: application/json
{"greeting": "Hello, http.md!"}
```
And here is the response:
::response

View File

@@ -0,0 +1,22 @@
# Document with Multiple Requests
First, create a resource:
```http id=createUser
POST https://httpbin.org/post
Content-Type: application/json
{"username": "alpha"}
```
Then, fetch a different resource:
```http id=getItem
GET https://httpbin.org/get?item=123
```
Response from creating the user:
::response{#createUser}
Response from getting the item:
::response{#getItem}

View File

@@ -0,0 +1,16 @@
```http id=createItem json
POST https://httpbin.org/post
Content-Type: application/json
{"name": "My New Item"}
```
The new item ID is: {{responses.createItem.body.json.name}}
Now, let's fetch the item using a (mocked) ID from the response:
```http id=fetchItem
GET https://httpbin.org/anything/{{responses.createItem.body.json.name}}
```
::response{#fetchItem}