Closed amanve closed 2 years ago
Response-
{
"errors": [
{
"code": null,
"detail": "Accept header, if specified, must be the JSON API media type: application/vnd.api+json",
"id": null,
"links": null,
"meta": null,
"source": null,
"status": "406",
"title": null
}
],
"jsonapi": {
"version": "1.0"
}
}
Hi, could you please provide more details on how do you make that request? Do you pass the Accept
header?
Hi, could you please provide more details on how do you make that request? Do you pass the
Accept
header?
Content-Length: 248 Content-Type: application/vnd.api+json Date: Tue, 15 Mar 2022 04:58:01 GMT Server: Werkzeug/2.0.3 Python/3.10.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,/;q=0.8 Accept-Encoding: gzip, deflate Accept-Language: en-US,en;q=0.5 Connection: keep-alive Host: localhost:5000 Sec-Fetch-Dest: document Sec-Fetch-Mode: navigate Sec-Fetch-Site: none Sec-Fetch-User: ?1 Upgrade-Insecure-Requests: 1 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:98.0) Gecko/20100101 Firefox/98.0
ok now i got it-
https://flask-restless-ng.readthedocs.io/en/latest/requestformat.html
application/vnd.api+json
is the header
Right, so as you can see from the error's details, it expects Accept: application/vnd.api+json
, not 'text/html'
you can try curl -H 'Accept: application/vnd.api+json' http://...
Hi,
whenever i try to GET response it returns 406 Not Acceptable. I'm using flask-sqlalchemy