servant/servant-docs/example/greet.md

123 lines
2.1 KiB
Markdown
Raw Permalink Normal View History

## On proper introductions.
Hello there.
As documentation is usually written for humans, it's often useful to introduce concepts with a few words.
## This title is below the last
You'll also note that multiple intros are possible.
## POST /greet
2018-09-29 17:50:23 +02:00
### Request:
- Supported content types are:
2018-09-29 17:50:23 +02:00
- `application/json;charset=utf-8`
- `application/json`
2018-09-29 17:50:23 +02:00
- If you use ?capital=true (`application/json;charset=utf-8`, `application/json`):
```javascript
"HELLO, HASKELLER"
```
2018-09-29 17:50:23 +02:00
- If you use ?capital=false (`application/json;charset=utf-8`, `application/json`):
2018-09-29 17:50:23 +02:00
```javascript
"Hello, haskeller"
```
### Response:
- Status code 200
- Headers: [("X-Example","1729")]
- Supported content types are:
2018-09-29 17:50:23 +02:00
- `application/json;charset=utf-8`
- `application/json`
2018-09-29 17:50:23 +02:00
- If you use ?capital=true (`application/json;charset=utf-8`, `application/json`):
```javascript
"HELLO, HASKELLER"
```
2018-09-29 17:50:23 +02:00
- If you use ?capital=false (`application/json;charset=utf-8`, `application/json`):
```javascript
"Hello, haskeller"
```
## DELETE /greet/:greetid
2018-09-29 17:50:23 +02:00
### Title
This is some text
### Second section
And some more
2018-09-29 17:50:23 +02:00
### Captures:
- *greetid*: identifier of the greet msg to remove
2018-09-29 17:50:23 +02:00
### Headers:
- This endpoint is sensitive to the value of the **unicorns** HTTP header.
2018-09-29 17:50:23 +02:00
### Response:
- Status code 200
- Headers: []
- Supported content types are:
2018-09-29 17:50:23 +02:00
- `application/json;charset=utf-8`
- `application/json`
2018-09-29 17:50:23 +02:00
- Example (`application/json;charset=utf-8`, `application/json`):
```javascript
2018-09-29 17:50:23 +02:00
```
## GET /hello/:name
2018-09-29 17:50:23 +02:00
### Captures:
- *name*: name of the person to greet
2018-09-29 17:50:23 +02:00
### GET Parameters:
- capital
- **Values**: *true, false*
- **Description**: Get the greeting message in uppercase (true) or not (false).Default is false.
2018-09-29 17:50:23 +02:00
### Response:
- Status code 200
- Headers: []
- Supported content types are:
2018-09-29 17:50:23 +02:00
- `application/json;charset=utf-8`
- `application/json`
- `text/plain;charset=utf-8`
2018-09-29 17:50:23 +02:00
- If you use ?capital=true (`application/json;charset=utf-8`, `application/json`, `text/plain;charset=utf-8`):
```javascript
"HELLO, HASKELLER"
```
2018-09-29 17:50:23 +02:00
- If you use ?capital=false (`application/json;charset=utf-8`, `application/json`):
```javascript
"Hello, haskeller"
```