Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rest: add note on content type #729

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions docs/reference/rest_api_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,15 @@ curl -k https://127.0.0.1:5000/api/records?access_token=API-TOKEN
The `-k` or `--insecure` option here is simply because a certificate is typically not setup locally. In production,
your `curl` calls shouldn't need this option because you will be using a valid certificate.

_Introduced in InvenioRDM v12_
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think pointing out the content-type is good info, although I think it's been around for a while (v9 at least I think). In fact, investigating the practical difference between using application/vnd.inveniordm.v1+json and application/json and documenting that would be the nugget of value here. I think one of them does the ui serialization or does it differently or something like that... Let's document that aspect and we won't have to version mark it either this way 👍

When making requests to the new REST API endpoints introduced in v12, you can set the Content-Type header to:

```shell
Content-Type: application/vnd.inveniordm.v1+json
```

Including Content-Type ensures that the server correctly interprets your request payloads according to the new API specifications introduced in v12. While the `application/json` Content-Type is still supported, it is recommended to use the new Content-Type to ensure compatibility with future versions of InvenioRDM.

### Scopes

!!! warning "Work in progress"
Expand Down