Skip to content
This repository was archived by the owner on Aug 5, 2021. It is now read-only.

Commit effa7e9

Browse files
committed
Update docs for headers
1 parent 03a6589 commit effa7e9

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

source/v1/index.html.md

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ Be sure to include an `Accept: application/json` header, otherwise errors like `
141141
### Exposed Headers
142142

143143
- `Content-Type`(`application/json` or the filetype, e.g. `image/png`)
144-
- `Content-Disposition` (only for files, defaults to `attachment; filename="filename.ext"`)
144+
- `Content-Disposition` (only for files, defaults to `inline`)
145145

146146
### For Pagination
147147
See [pagination](#pagination)
@@ -161,19 +161,18 @@ See [pagination](#pagination)
161161
```
162162
/v1/users
163163
```
164-
> Get Route
164+
> Update Route
165165
166166
```
167167
/v1/users/1
168168
```
169169

170170
All returned model resources have an `ETag` and `Last-Modified` header.
171171

172-
`ETag` are returned from get, create & update requests.
173-
Because the ETags are weak they can be used on other routes as well.
172+
`ETag` headers are returned from GET, Create & Update requests.
173+
Because the ETags are weak they can also be used on other routes.
174174

175-
For example, when creating a new resource, the API will return an `ETag`,
176-
this `ETag` can be used on the get route to check if the resource has been modified since creating it.
175+
For example, when getting a resource the API will return a `ETag` header, the value of the `ETag` header can be used on the update route prevent [the lost update problem](https://www.morpheusdata.com/blog/2015-02-21-lost-update-db).
177176

178177
### We Also Expose CORS Headers
179178

@@ -186,7 +185,7 @@ this `ETag` can be used on the get route to check if the resource has been modif
186185
### Accepted Headers
187186

188187
- `Authorization`
189-
- `Accept`
188+
- `Accept` (should be set to `application/json` for all API requests)
190189
- `Content-Type`
191190

192191
### For Pagination
@@ -196,10 +195,14 @@ See [pagination](#pagination)
196195
- `X-Per-Page`
197196
- `X-Offset`
198197

199-
### For HTTP Caching
198+
### For Midair Collision Prevention
200199

201-
- `If-Match`
202-
- `If-Modified-Since`
200+
- [`If-Match`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match)
201+
- [`If-Unmodified-Since`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Unmodified-Since)
202+
203+
We follow the standard as described on mozilla developer network
204+
205+
If you submit any of these headers the API will assume you only want to update a resource when the header condition is met, omit these if you do not care about preventing [the lost update problem](https://www.morpheusdata.com/blog/2015-02-21-lost-update-db)
203206

204207
## Query Parameters
205208

0 commit comments

Comments
 (0)