Skip to content

Commit

Permalink
Fix a typo in the simple REST data provider for the create verb
Browse files Browse the repository at this point in the history
  • Loading branch information
Luwangel authored and JulienMattiussi committed Aug 24, 2020
1 parent e01879f commit 37c18b0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/ra-data-simple-rest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,21 @@ This Data Provider fits REST APIs using simple GET parameters for filters and so
| `getOne` | `GET http://my.api.url/posts/123` |
| `getMany` | `GET http://my.api.url/posts?filter={"id":[123,456,789]}` |
| `getManyReference` | `GET http://my.api.url/posts?filter={"author_id":345}` |
| `create` | `POST http://my.api.url/posts/123` |
| `create` | `POST http://my.api.url/posts` |
| `update` | `PUT http://my.api.url/posts/123` |
| `updateMany` | Multiple calls to `PUT http://my.api.url/posts/123` |
| `delete` | `DELETE http://my.api.url/posts/123` |
| `deleteMany` | Multiple calls to `DELETE http://my.api.url/posts/123` |

**Note**: The simple REST data provider expects the API to include a `Content-Range` header in the response to `getList` calls. The value must be the total number of resources in the collection. This allows react-admin to know how many pages of resources there are in total, and build the pagination controls.

```
```txt
Content-Range: posts 0-24/319
```

If your API is on another domain as the JS code, you'll need to whitelist this header with an `Access-Control-Expose-Headers` [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS) header.

```
```txt
Access-Control-Expose-Headers: Content-Range
```

Expand Down

0 comments on commit 37c18b0

Please sign in to comment.