2015-10-08 23:33:32 +02:00
|
|
|
## On proper introductions.
|
2014-12-08 11:25:52 +01:00
|
|
|
|
2015-01-23 02:19:37 +01:00
|
|
|
Hello there.
|
|
|
|
|
|
|
|
As documentation is usually written for humans, it's often useful to introduce concepts with a few words.
|
|
|
|
|
2015-10-08 23:33:32 +02:00
|
|
|
## This title is below the last
|
2015-01-23 02:19:37 +01:00
|
|
|
|
|
|
|
You'll also note that multiple intros are possible.
|
|
|
|
|
|
|
|
## POST /greet
|
|
|
|
|
2018-09-29 17:50:23 +02:00
|
|
|
### Request:
|
2014-12-08 11:25:52 +01:00
|
|
|
|
2015-02-23 00:23:12 +01:00
|
|
|
- Supported content types are:
|
|
|
|
|
2018-09-29 17:50:23 +02:00
|
|
|
- `application/json;charset=utf-8`
|
2015-02-23 00:23:12 +01:00
|
|
|
- `application/json`
|
|
|
|
|
2018-09-29 17:50:23 +02:00
|
|
|
- If you use ?capital=true (`application/json;charset=utf-8`, `application/json`):
|
2015-02-23 00:23:12 +01:00
|
|
|
|
|
|
|
```javascript
|
2015-10-08 23:33:32 +02:00
|
|
|
"HELLO, HASKELLER"
|
2014-12-08 11:25:52 +01:00
|
|
|
```
|
|
|
|
|
2018-09-29 17:50:23 +02:00
|
|
|
- If you use ?capital=false (`application/json;charset=utf-8`, `application/json`):
|
2014-12-08 11:25:52 +01:00
|
|
|
|
2018-09-29 17:50:23 +02:00
|
|
|
```javascript
|
|
|
|
"Hello, haskeller"
|
|
|
|
```
|
|
|
|
|
|
|
|
### Response:
|
|
|
|
|
|
|
|
- Status code 200
|
2015-10-08 23:33:32 +02:00
|
|
|
- Headers: [("X-Example","1729")]
|
2015-02-23 00:23:12 +01:00
|
|
|
|
|
|
|
- Supported content types are:
|
2014-12-08 11:25:52 +01:00
|
|
|
|
2018-09-29 17:50:23 +02:00
|
|
|
- `application/json;charset=utf-8`
|
2015-02-23 00:23:12 +01:00
|
|
|
- `application/json`
|
2014-12-08 11:25:52 +01:00
|
|
|
|
2018-09-29 17:50:23 +02:00
|
|
|
- If you use ?capital=true (`application/json;charset=utf-8`, `application/json`):
|
2015-02-23 00:23:12 +01:00
|
|
|
|
|
|
|
```javascript
|
2015-01-30 05:57:56 +01:00
|
|
|
"HELLO, HASKELLER"
|
2015-01-04 16:53:02 +01:00
|
|
|
```
|
|
|
|
|
2018-09-29 17:50:23 +02:00
|
|
|
- If you use ?capital=false (`application/json;charset=utf-8`, `application/json`):
|
2015-01-04 16:53:02 +01:00
|
|
|
|
2015-02-23 00:23:12 +01:00
|
|
|
```javascript
|
2015-01-30 05:57:56 +01:00
|
|
|
"Hello, haskeller"
|
2014-12-08 11:25:52 +01:00
|
|
|
```
|
|
|
|
|
2021-08-19 13:11:00 +02:00
|
|
|
### Sample Request:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
curl -XPOST \
|
|
|
|
-H "Content-Type: application/json;charset=utf-8" \
|
|
|
|
-d "\"HELLO, HASKELLER\"" \
|
|
|
|
http://localhost:80/greet
|
|
|
|
```
|
|
|
|
|
2015-10-08 23:33:32 +02:00
|
|
|
## DELETE /greet/:greetid
|
|
|
|
|
2018-09-29 17:50:23 +02:00
|
|
|
### Title
|
2015-10-08 23:33:32 +02:00
|
|
|
|
|
|
|
This is some text
|
|
|
|
|
2020-06-06 06:43:51 +02:00
|
|
|
### Second section
|
2015-10-08 23:33:32 +02:00
|
|
|
|
|
|
|
And some more
|
2014-12-08 11:25:52 +01:00
|
|
|
|
2018-09-29 17:50:23 +02:00
|
|
|
### Captures:
|
2014-12-08 11:25:52 +01:00
|
|
|
|
2015-10-08 23:33:32 +02:00
|
|
|
- *greetid*: identifier of the greet msg to remove
|
2014-12-08 11:25:52 +01:00
|
|
|
|
2018-09-29 17:50:23 +02:00
|
|
|
### Headers:
|
2015-01-30 05:57:56 +01:00
|
|
|
|
2021-08-19 13:11:00 +02:00
|
|
|
- This endpoint is sensitive to the value of the **X-Num-Unicorns** HTTP header.
|
2015-01-30 05:57:56 +01:00
|
|
|
|
2018-09-29 17:50:23 +02:00
|
|
|
### Response:
|
2015-10-08 23:33:32 +02:00
|
|
|
|
|
|
|
- Status code 200
|
|
|
|
- Headers: []
|
|
|
|
|
|
|
|
- Supported content types are:
|
|
|
|
|
2018-09-29 17:50:23 +02:00
|
|
|
- `application/json;charset=utf-8`
|
2015-10-08 23:33:32 +02:00
|
|
|
- `application/json`
|
|
|
|
|
2018-09-29 17:50:23 +02:00
|
|
|
- Example (`application/json;charset=utf-8`, `application/json`):
|
2015-10-08 23:33:32 +02:00
|
|
|
|
|
|
|
```javascript
|
2018-09-29 17:50:23 +02:00
|
|
|
|
2015-10-08 23:33:32 +02:00
|
|
|
```
|
2015-01-30 05:57:56 +01:00
|
|
|
|
2021-08-19 13:11:00 +02:00
|
|
|
### Sample Request:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
curl -XDELETE \
|
|
|
|
-H "X-Num-Unicorns: 1" \
|
|
|
|
http://localhost:80/greet/:greetid
|
|
|
|
```
|
|
|
|
|
2015-10-08 23:33:32 +02:00
|
|
|
## GET /hello/:name
|
2015-01-30 05:57:56 +01:00
|
|
|
|
2018-09-29 17:50:23 +02:00
|
|
|
### Captures:
|
2015-10-08 23:33:32 +02:00
|
|
|
|
|
|
|
- *name*: name of the person to greet
|
2015-01-30 05:57:56 +01:00
|
|
|
|
2021-08-19 13:11:00 +02:00
|
|
|
### Headers:
|
|
|
|
|
|
|
|
- This endpoint is sensitive to the value of the **X-Num-Fairies** HTTP header.
|
|
|
|
|
2018-09-29 17:50:23 +02:00
|
|
|
### GET Parameters:
|
2014-12-08 11:25:52 +01:00
|
|
|
|
2015-02-23 00:23:12 +01:00
|
|
|
- capital
|
2014-12-08 11:25:52 +01:00
|
|
|
- **Values**: *true, false*
|
2015-01-30 05:57:56 +01:00
|
|
|
- **Description**: Get the greeting message in uppercase (true) or not (false).Default is false.
|
2014-12-08 11:25:52 +01:00
|
|
|
|
|
|
|
|
2018-09-29 17:50:23 +02:00
|
|
|
### Response:
|
2014-12-08 11:25:52 +01:00
|
|
|
|
2015-02-23 00:23:12 +01:00
|
|
|
- Status code 200
|
2015-10-08 23:33:32 +02:00
|
|
|
- Headers: []
|
2014-12-08 11:25:52 +01:00
|
|
|
|
2015-02-23 00:23:12 +01:00
|
|
|
- Supported content types are:
|
|
|
|
|
2018-09-29 17:50:23 +02:00
|
|
|
- `application/json;charset=utf-8`
|
2015-02-23 00:23:12 +01:00
|
|
|
- `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`):
|
2015-02-23 00:23:12 +01:00
|
|
|
|
|
|
|
```javascript
|
2015-01-30 05:57:56 +01:00
|
|
|
"HELLO, HASKELLER"
|
2015-01-04 16:53:02 +01:00
|
|
|
```
|
|
|
|
|
2018-09-29 17:50:23 +02:00
|
|
|
- If you use ?capital=false (`application/json;charset=utf-8`, `application/json`):
|
2015-02-23 00:23:12 +01:00
|
|
|
|
|
|
|
```javascript
|
|
|
|
"Hello, haskeller"
|
|
|
|
```
|
2021-08-19 13:11:00 +02:00
|
|
|
|
|
|
|
### Sample Request:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
curl -XGET \
|
|
|
|
-H "X-Num-Fairies: 1729" \
|
|
|
|
http://localhost:80/hello/:name
|
|
|
|
```
|
|
|
|
|
|
|
|
|