TestingAPIs is still being built. If something breaks, email support@testingapis.com.

Return the same user in the format chosen by the Accept header

GEThttps://api.testingapis.com/api/formats/negotiateSign in to see this endpoint's URL

Return the same user in the format chosen by the Accept header.

Supported media types: application/json, application/xml, text/xml, text/html, text/plain and text/csv. Types are tried in descending q-value order and q=0 excludes a type. */* and application/* map to JSON, text/* maps to plain text, and a missing Accept header yields JSON. Every response carries Vary: Accept. Every format carries the same fields as the JSON.

Responses

200
The user in the negotiated format.
406
No acceptable media type; the body lists the supported ones.

Example

Request
curl -X GET "https://api.testingapis.com/api/formats/negotiate" \
  -H "Accept: text/csv" \
  -H "X-TestingApis-Key: YOUR_API_KEY"
Response200 OK
Content-Type: text/csv; charset=utf-8
Vary: Accept

id,name,email,roles,active,score,manager
1,Alice Johnson,alice@example.com,admin;editor,true,98.5,

Sign in to see the details

The parameters, request and response examples and the live Try it panel for this endpoint are for signed-in members. Accounts are free and take a few seconds to create.