Correct line breaks.
This commit is contained in:
+24
-12
@@ -98,7 +98,8 @@ TODO: Intro to Architecture
|
|||||||
|
|
||||||
### Core Concepts
|
### Core Concepts
|
||||||
|
|
||||||
In this section we are going to define several concepts that will be used frequently throughout the spec.
|
In this section we are going to define several concepts that will be used
|
||||||
|
frequently throughout the spec.
|
||||||
|
|
||||||
|
|
||||||
#### `entrypoint`
|
#### `entrypoint`
|
||||||
@@ -208,12 +209,14 @@ field must be a json scaped string.
|
|||||||
]
|
]
|
||||||
```
|
```
|
||||||
* **Sample Call**: `$ curl $KAPOW_URL/routes`
|
* **Sample Call**: `$ curl $KAPOW_URL/routes`
|
||||||
* **Notes**: Currently all routes are returned; in the future, a filter may be accepted.
|
* **Notes**: Currently all routes are returned; in the future, a filter may be
|
||||||
|
accepted.
|
||||||
|
|
||||||
|
|
||||||
#### Append route
|
#### Append route
|
||||||
|
|
||||||
Accepts JSON data that defines a new route to be appended to the current routes. A new id is created for the appended route so it can be referenced later.
|
Accepts JSON data that defines a new route to be appended to the current routes.
|
||||||
|
A new id is created for the appended route so it can be referenced later.
|
||||||
|
|
||||||
* **URL**: `/routes`
|
* **URL**: `/routes`
|
||||||
* **Method**: `POST`
|
* **Method**: `POST`
|
||||||
@@ -265,7 +268,8 @@ Accepts JSON data that defines a new route to be appended to the current routes.
|
|||||||
#### Insert a route
|
#### Insert a route
|
||||||
|
|
||||||
Accepts JSON data that defines a new route to be inserted at the specified
|
Accepts JSON data that defines a new route to be inserted at the specified
|
||||||
index to the current routes. A new id is created for the inserted route so it can be referenced later.
|
index to the current routes. A new id is created for the inserted route so it
|
||||||
|
can be referenced later.
|
||||||
|
|
||||||
* **URL**: `/routes`
|
* **URL**: `/routes`
|
||||||
* **Method**: `PUT`
|
* **Method**: `PUT`
|
||||||
@@ -431,11 +435,13 @@ following resource paths:
|
|||||||
- Returned Value: `foo`
|
- Returned Value: `foo`
|
||||||
- Comment: That would provide read-only access to the request URL parameter `q`.
|
- Comment: That would provide read-only access to the request URL parameter `q`.
|
||||||
- Obtain the `Content-Type` header of the request.
|
- Obtain the `Content-Type` header of the request.
|
||||||
- Scenario: A POST request with a JSON body and the header `Content-Type` set to `application/json`.
|
- Scenario: A POST request with a JSON body and the header `Content-Type` set
|
||||||
|
to `application/json`.
|
||||||
- Key: `/request/headers/Content-Type`
|
- Key: `/request/headers/Content-Type`
|
||||||
- Access: Read-Only
|
- Access: Read-Only
|
||||||
- Returned Value: `application/json`
|
- Returned Value: `application/json`
|
||||||
- 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
|
```html
|
||||||
@@ -450,21 +456,24 @@ following resource paths:
|
|||||||
- Key: `/request/form/firstname`
|
- Key: `/request/form/firstname`
|
||||||
- Access: Read-Only
|
- Access: Read-Only
|
||||||
- Returned Value: `Jane`
|
- Returned Value: `Jane`
|
||||||
- Comment: That would provide read-only access to the value of the field `firstname` of the form.
|
- Comment: That would provide read-only access to the value of the field
|
||||||
|
`firstname` of the form.
|
||||||
- Set the response status code.
|
- Set the response status code.
|
||||||
- Scenario: A request is being attended.
|
- Scenario: A request is being attended.
|
||||||
- Key: `/response/status`
|
- Key: `/response/status`
|
||||||
- Access: Write-Only
|
- Access: Write-Only
|
||||||
- Acceptable Value: A 3-digit integer. Must match `[0-9]{3}`.
|
- Acceptable Value: A 3-digit integer. Must match `[0-9]{3}`.
|
||||||
- Default Value: `200`
|
- Default Value: `200`
|
||||||
- Comment: It is customary to use the HTTP status code as defined at [https://www.w3.org/Protocols/rfc2616/rfc2616-sec6.html#sec6.1.1](RFC2616).
|
- Comment: It is customary to use the HTTP status code as defined at
|
||||||
|
[https://www.w3.org/Protocols/rfc2616/rfc2616-sec6.html#sec6.1.1](RFC2616).
|
||||||
- Set the response body.
|
- Set the response body.
|
||||||
- Scenario: A request is being attended.
|
- Scenario: A request is being attended.
|
||||||
- Key: `/response/body`
|
- Key: `/response/body`
|
||||||
- Access: Write-Only
|
- Access: Write-Only
|
||||||
- Acceptable Value: Any string of bytes.
|
- Acceptable Value: Any string of bytes.
|
||||||
- Default Value: N/A
|
- Default Value: N/A
|
||||||
- Comment: For media types other than `application/octet-stream` you should specify the appropiate `Content-Type` header.
|
- Comment: For media types other than `application/octet-stream` you should
|
||||||
|
specify the appropiate `Content-Type` header.
|
||||||
|
|
||||||
**Note**: Parameters under `request` are read-only and, conversely, parameters under
|
**Note**: Parameters under `request` are read-only and, conversely, parameters under
|
||||||
`response` are write-only.
|
`response` are write-only.
|
||||||
@@ -472,11 +481,13 @@ following resource paths:
|
|||||||
|
|
||||||
#### Get handler resource
|
#### Get handler resource
|
||||||
|
|
||||||
Returns the value of the requested resource path, or an error if the resource path doesn't exist or is invalid.
|
Returns the value of the requested resource path, or an error if the resource
|
||||||
|
path doesn't exist or is invalid.
|
||||||
|
|
||||||
* **URL**: `/handlers/{:handler_id}{:resource_path}`
|
* **URL**: `/handlers/{:handler_id}{:resource_path}`
|
||||||
* **Method**: `GET`
|
* **Method**: `GET`
|
||||||
* **URL Params**: FIXME: We think that here should be options to cook the value in some way, or get it raw.
|
* **URL Params**: FIXME: We think that here should be options to cook the value
|
||||||
|
in some way, or get it raw.
|
||||||
* **Success Responses**:
|
* **Success Responses**:
|
||||||
* **Code**: `200 OK`<br />
|
* **Code**: `200 OK`<br />
|
||||||
**Header**: `Content-Type: application/octet-stream`<br />
|
**Header**: `Content-Type: application/octet-stream`<br />
|
||||||
@@ -496,7 +507,8 @@ Returns the value of the requested resource path, or an error if the resource pa
|
|||||||
|
|
||||||
* **URL**: `/handlers/{:handler_id}{:resource_path}`
|
* **URL**: `/handlers/{:handler_id}{:resource_path}`
|
||||||
* **Method**: `PUT`
|
* **Method**: `PUT`
|
||||||
* **URL Params**: FIXME: We think that here should be options to cook the value in some way, or pass it raw.
|
* **URL Params**: FIXME: We think that here should be options to cook the value
|
||||||
|
in some way, or pass it raw.
|
||||||
* **Data Params**: Binary payload.
|
* **Data Params**: Binary payload.
|
||||||
* **Success Responses**:
|
* **Success Responses**:
|
||||||
* **Code**: `200 OK`
|
* **Code**: `200 OK`
|
||||||
|
|||||||
Reference in New Issue
Block a user