spec: enable syntax highlighting for code snippets
This commit is contained in:
+16
-16
@@ -127,12 +127,12 @@ whole lifetime of the server.
|
|||||||
deleted).
|
deleted).
|
||||||
|
|
||||||
For instance, given this request:
|
For instance, given this request:
|
||||||
```
|
```http
|
||||||
HTTP/1.1 GET /routes
|
HTTP/1.1 GET /routes
|
||||||
```
|
```
|
||||||
|
|
||||||
an appropiate reponse may look like this:
|
an appropiate reponse may look like this:
|
||||||
```
|
```http
|
||||||
200 OK
|
200 OK
|
||||||
Content-Type: application/json
|
Content-Type: application/json
|
||||||
Content-Length: 189
|
Content-Length: 189
|
||||||
@@ -169,7 +169,7 @@ Returns JSON data about the current routes.
|
|||||||
* **Success Responses**:
|
* **Success Responses**:
|
||||||
* **Code**: `200 OK`<br />
|
* **Code**: `200 OK`<br />
|
||||||
**Content**:<br />
|
**Content**:<br />
|
||||||
```
|
```json
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"method": "GET",
|
"method": "GET",
|
||||||
@@ -197,7 +197,7 @@ Accepts JSON data that defines a new route to be appended to the current routes.
|
|||||||
* **Method**: `POST`
|
* **Method**: `POST`
|
||||||
* **Header**: `Content-Type: application/json`
|
* **Header**: `Content-Type: application/json`
|
||||||
* **Data Params**:<br />
|
* **Data Params**:<br />
|
||||||
```
|
```json
|
||||||
{
|
{
|
||||||
"method": "GET",
|
"method": "GET",
|
||||||
"url_pattern": "/hello",
|
"url_pattern": "/hello",
|
||||||
@@ -209,7 +209,7 @@ Accepts JSON data that defines a new route to be appended to the current routes.
|
|||||||
* **Code**: `201 Created`<br />
|
* **Code**: `201 Created`<br />
|
||||||
**Header**: `Content-Type: application/json`<br />
|
**Header**: `Content-Type: application/json`<br />
|
||||||
**Content**:<br />
|
**Content**:<br />
|
||||||
```
|
```json
|
||||||
{
|
{
|
||||||
"method": "GET",
|
"method": "GET",
|
||||||
"url_pattern": "/hello",
|
"url_pattern": "/hello",
|
||||||
@@ -225,7 +225,7 @@ Accepts JSON data that defines a new route to be appended to the current routes.
|
|||||||
* **Code**: `400 Missing Mandatory Field`<br />
|
* **Code**: `400 Missing Mandatory Field`<br />
|
||||||
**Header**: `Content-Type: application/json`<br />
|
**Header**: `Content-Type: application/json`<br />
|
||||||
**Content**:
|
**Content**:
|
||||||
```
|
```json
|
||||||
{
|
{
|
||||||
"missing_mandatory_fields": [
|
"missing_mandatory_fields": [
|
||||||
"url_pattern",
|
"url_pattern",
|
||||||
@@ -234,7 +234,7 @@ Accepts JSON data that defines a new route to be appended to the current routes.
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
* **Sample Call**:
|
* **Sample Call**:
|
||||||
```
|
```sh
|
||||||
$ curl -X POST --data-binary @- $KAPOW_URL/routes <<EOF
|
$ curl -X POST --data-binary @- $KAPOW_URL/routes <<EOF
|
||||||
{
|
{
|
||||||
"method": "GET",
|
"method": "GET",
|
||||||
@@ -261,7 +261,7 @@ Accepts JSON data that defines a new route to be appended to the current routes.
|
|||||||
* **Method**: `PUT`
|
* **Method**: `PUT`
|
||||||
* **Header**: `Content-Type: application/json`
|
* **Header**: `Content-Type: application/json`
|
||||||
* **Data Params**:<br />
|
* **Data Params**:<br />
|
||||||
```
|
```json
|
||||||
{
|
{
|
||||||
"method": "GET",
|
"method": "GET",
|
||||||
"url_pattern": "/hello",
|
"url_pattern": "/hello",
|
||||||
@@ -273,7 +273,7 @@ Accepts JSON data that defines a new route to be appended to the current routes.
|
|||||||
* **Code**: `200 OK`<br />
|
* **Code**: `200 OK`<br />
|
||||||
**Header**: `Content-Type: application/json`<br />
|
**Header**: `Content-Type: application/json`<br />
|
||||||
**Content**:<br />
|
**Content**:<br />
|
||||||
```
|
```json
|
||||||
{
|
{
|
||||||
"method": "GET",
|
"method": "GET",
|
||||||
"url_pattern": "/hello",
|
"url_pattern": "/hello",
|
||||||
@@ -289,7 +289,7 @@ Accepts JSON data that defines a new route to be appended to the current routes.
|
|||||||
* **Code**: `400 Missing Mandatory Field`<br />
|
* **Code**: `400 Missing Mandatory Field`<br />
|
||||||
**Header**: `Content-Type: application/json`<br />
|
**Header**: `Content-Type: application/json`<br />
|
||||||
**Content**:
|
**Content**:
|
||||||
```
|
```json
|
||||||
{
|
{
|
||||||
"missing_mandatory_fields": [
|
"missing_mandatory_fields": [
|
||||||
"url_pattern",
|
"url_pattern",
|
||||||
@@ -302,7 +302,7 @@ Accepts JSON data that defines a new route to be appended to the current routes.
|
|||||||
* **Code**: `404 Invalid Index`
|
* **Code**: `404 Invalid Index`
|
||||||
* **Code**: `404 Invalid Route Spec`
|
* **Code**: `404 Invalid Route Spec`
|
||||||
* **Sample Call**:
|
* **Sample Call**:
|
||||||
```
|
```sh
|
||||||
$ curl -X PUT --data-binary @- $KAPOW_URL/routes <<EOF`
|
$ curl -X PUT --data-binary @- $KAPOW_URL/routes <<EOF`
|
||||||
{
|
{
|
||||||
"method": "GET",
|
"method": "GET",
|
||||||
@@ -332,7 +332,7 @@ Removes the route identified by `:id`.
|
|||||||
* **Success Responses**:
|
* **Success Responses**:
|
||||||
* **Code**: `200 OK`<br />
|
* **Code**: `200 OK`<br />
|
||||||
**Content**:
|
**Content**:
|
||||||
```
|
```json
|
||||||
{
|
{
|
||||||
"method": "GET",
|
"method": "GET",
|
||||||
"url_pattern": "/hello",
|
"url_pattern": "/hello",
|
||||||
@@ -344,7 +344,7 @@ Removes the route identified by `:id`.
|
|||||||
* **Error Responses**:
|
* **Error Responses**:
|
||||||
* **Code**: `404 Not Found`
|
* **Code**: `404 Not Found`
|
||||||
* **Sample Call**:
|
* **Sample Call**:
|
||||||
```
|
```sh
|
||||||
$ curl -X DELETE $KAPOW_URL/routes/ROUTE_1f186c92_f906_4506_9788_a1f541b11d0f
|
$ curl -X DELETE $KAPOW_URL/routes/ROUTE_1f186c92_f906_4506_9788_a1f541b11d0f
|
||||||
```
|
```
|
||||||
* **Notes**:
|
* **Notes**:
|
||||||
@@ -442,7 +442,7 @@ following resource paths:
|
|||||||
- Comment: That would provide read-only access to the value of the request header `Content-Type`.
|
- Comment: That would provide read-only access to the value of the request header `Content-Type`.
|
||||||
- Read a field from a form.
|
- Read a field from a form.
|
||||||
- Scenario: A request generated by submitting this form:<br />
|
- Scenario: A request generated by submitting this form:<br />
|
||||||
```
|
```html
|
||||||
<form method="post">
|
<form method="post">
|
||||||
First name:<br>
|
First name:<br>
|
||||||
<input type="text" name="firstname" value="Jane"><br>
|
<input type="text" name="firstname" value="Jane"><br>
|
||||||
@@ -490,7 +490,7 @@ Returns the value of the requested resource path, or an error if the resource pa
|
|||||||
**Notes**: Check the list of valid resource paths at the top of this section.
|
**Notes**: Check the list of valid resource paths at the top of this section.
|
||||||
* **Code**: `404 Not Found`
|
* **Code**: `404 Not Found`
|
||||||
* **Sample Call**:
|
* **Sample Call**:
|
||||||
```
|
```sh
|
||||||
$ curl /handlers/$KAPOW_HANDLER_ID/request/body
|
$ curl /handlers/$KAPOW_HANDLER_ID/request/body
|
||||||
```
|
```
|
||||||
* **Notes**: TODO
|
* **Notes**: TODO
|
||||||
@@ -512,7 +512,7 @@ Returns the value of the requested resource path, or an error if the resource pa
|
|||||||
* **Code**: `404 Name Not Found`<br />
|
* **Code**: `404 Name Not Found`<br />
|
||||||
**Notes**: Although the resource path is correct, no such name is present in the request. For instance, `/request/headers/Foo`, when no `Foo` header is not present in the request.
|
**Notes**: Although the resource path is correct, no such name is present in the request. For instance, `/request/headers/Foo`, when no `Foo` header is not present in the request.
|
||||||
* **Sample Call**:
|
* **Sample Call**:
|
||||||
```
|
```sh
|
||||||
FIXME: python snippet instead?
|
FIXME: python snippet instead?
|
||||||
$ curl -X PUT /handlers/$KAPOW_HANDLER_ID/response/body < /tmp/some_file
|
$ curl -X PUT /handlers/$KAPOW_HANDLER_ID/response/body < /tmp/some_file
|
||||||
```
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user