From 823974551d07de91bcc8e4b815b7938b5a97e6b4 Mon Sep 17 00:00:00 2001 From: pancho horrillo Date: Wed, 29 May 2019 10:05:32 +0200 Subject: [PATCH] spec: enable syntax highlighting for code snippets --- spec/README.md | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/spec/README.md b/spec/README.md index 59ae196..de56d70 100644 --- a/spec/README.md +++ b/spec/README.md @@ -127,12 +127,12 @@ whole lifetime of the server. deleted). For instance, given this request: -``` +```http HTTP/1.1 GET /routes ``` an appropiate reponse may look like this: -``` +```http 200 OK Content-Type: application/json Content-Length: 189 @@ -169,7 +169,7 @@ Returns JSON data about the current routes. * **Success Responses**: * **Code**: `200 OK`
**Content**:
- ``` + ```json [ { "method": "GET", @@ -197,7 +197,7 @@ Accepts JSON data that defines a new route to be appended to the current routes. * **Method**: `POST` * **Header**: `Content-Type: application/json` * **Data Params**:
- ``` + ```json { "method": "GET", "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`
**Header**: `Content-Type: application/json`
**Content**:
- ``` + ```json { "method": "GET", "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`
**Header**: `Content-Type: application/json`
**Content**: - ``` + ```json { "missing_mandatory_fields": [ "url_pattern", @@ -234,7 +234,7 @@ Accepts JSON data that defines a new route to be appended to the current routes. } ``` * **Sample Call**: - ``` + ```sh $ curl -X POST --data-binary @- $KAPOW_URL/routes < - ``` + ```json { "method": "GET", "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`
**Header**: `Content-Type: application/json`
**Content**:
- ``` + ```json { "method": "GET", "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`
**Header**: `Content-Type: application/json`
**Content**: - ``` + ```json { "missing_mandatory_fields": [ "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 Route Spec` * **Sample Call**: - ``` + ```sh $ curl -X PUT --data-binary @- $KAPOW_URL/routes < **Content**: - ``` + ```json { "method": "GET", "url_pattern": "/hello", @@ -344,7 +344,7 @@ Removes the route identified by `:id`. * **Error Responses**: * **Code**: `404 Not Found` * **Sample Call**: - ``` + ```sh $ curl -X DELETE $KAPOW_URL/routes/ROUTE_1f186c92_f906_4506_9788_a1f541b11d0f ``` * **Notes**: @@ -442,7 +442,7 @@ following resource paths: - Comment: That would provide read-only access to the value of the request header `Content-Type`. - Read a field from a form. - Scenario: A request generated by submitting this form:
- ``` + ```html
First name:

@@ -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. * **Code**: `404 Not Found` * **Sample Call**: - ``` + ```sh $ curl /handlers/$KAPOW_HANDLER_ID/request/body ``` * **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`
**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**: - ``` + ```sh FIXME: python snippet instead? $ curl -X PUT /handlers/$KAPOW_HANDLER_ID/response/body < /tmp/some_file ```