ajtran303 / whether_sweater

A weather data API with geolocation and image search services.
0 stars 0 forks source link

read json api spec #2

Open ajtran303 opened 3 years ago

ajtran303 commented 3 years ago

Content Negotiation

Client Responsibilities

Clients MUST send all JSON:API data in request documents with the header Content-Type: application/vnd.api+json without any media type parameters.

Clients that include the JSON:API media type in their Accept header MUST specify the media type there at least once without any media type parameters.

Clients MUST ignore any parameters for the application/vnd.api+json media type received in the Content-Type header of response documents.

Server Responsibilities

Servers MUST send all JSON:API data in response documents with the header Content-Type: application/vnd.api+json without any media type parameters.

Servers MUST respond with a 415 Unsupported Media Type status code if a request specifies the header Content-Type: application/vnd.api+json with any media type parameters.

Servers MUST respond with a 406 Not Acceptable status code if a request’s Accept header contains the JSON:API media type and all instances of that media type are modified with media type parameters.

ajtran303 commented 3 years ago

A document MUST contain at least one of the following top-level members:

data: the document’s “primary data” errors: an array of error objects meta: a meta object that contains non-standard meta-information.

ajtran303 commented 3 years ago

The members data and errors MUST NOT coexist in the same document.