Response formats
Hardcoded responses in every common content type, plus content negotiation, pre-compressed bodies, charsets and deliberately broken payloads for negative testing.
Your account unlocks these endpoints. Try it on each endpoint's page sends your key for you; from your own code, send a key from your API keys page in the X-TestingApis-Key header.
These endpoints need a free account. Create one or sign in to see their details and try them here.
- GET
https://api.testingapis.com/api/formatsList every available format and special-case endpointList every available format and special-case endpoint. - GET
https://api.testingapis.com/api/formats/atomReturn a sample Atom feed with two entriesReturn a sample Atom feed with two entries. - GET
https://api.testingapis.com/api/formats/bomReturn JSON prefixed with a UTF-8 byte-order markReturn JSON prefixed with a UTF-8 byte-order mark. - GET
https://api.testingapis.com/api/formats/brotliReturn a Brotli-compressed JSON bodyReturn a Brotli-compressed JSON body. - GET
https://api.testingapis.com/api/formats/charset/{name}Return text encoded in a non-UTF-8 charsetReturn text encoded in a non-UTF-8 charset. - GET
https://api.testingapis.com/api/formats/cssReturn a sample CSS stylesheetReturn a sample CSS stylesheet. - GET
https://api.testingapis.com/api/formats/csvReturn a sample employee table as RFC 4180 text/csvReturn a sample employee table as RFC 4180text/csv. - GET
https://api.testingapis.com/api/formats/deflateReturn a deflate-compressed JSON bodyReturn a deflate-compressed JSON body. - GET
https://api.testingapis.com/api/formats/emptyReturn 200 OK with a zero-length body and no Content-TypeReturn 200 OK with a zero-length body and no Content-Type. - GET
https://api.testingapis.com/api/formats/gifReturn a 1×1 transparent GIF89a imageReturn a 1×1 transparent GIF89a image. - GET
https://api.testingapis.com/api/formats/gzipReturn a gzip-compressed JSON bodyReturn a gzip-compressed JSON body. - GET
https://api.testingapis.com/api/formats/htmlReturn a sample HTML page with a list, a table and a formReturn a sample HTML page with a list, a table and a form. - GET
https://api.testingapis.com/api/formats/icalReturn a sample iCalendarReturn a sample iCalendar (.ics) event with CRLF line endings. - GET
https://api.testingapis.com/api/formats/javascriptReturn a small runnable JavaScript snippetReturn a small runnable JavaScript snippet. - GET
https://api.testingapis.com/api/formats/jsonReturn a sample user object as application/jsonReturn a sample user object asapplication/json. - GET
https://api.testingapis.com/api/formats/jsonpWrap the sample JSON in a JSONP callbackWrap the sample JSON in a JSONP callback. - GET
https://api.testingapis.com/api/formats/malformed-jsonReturn deliberately invalid JSON labelled application/jsonReturn deliberately invalid JSON labelledapplication/json. - GET
https://api.testingapis.com/api/formats/markdownReturn a sample Markdown document with a table and a code blockReturn a sample Markdown document with a table and a code block. - GET
https://api.testingapis.com/api/formats/negotiateReturn the same user in the format chosen by the Accept headerReturn the same user in the format chosen by theAcceptheader. - GET
https://api.testingapis.com/api/formats/no-contentReturn 204 No ContentReturn 204 No Content. - GET
https://api.testingapis.com/api/formats/pdfReturn a minimal valid single-page PDFReturn a minimal valid single-page PDF. - GET
https://api.testingapis.com/api/formats/pngGenerate a real, valid PNG imageGenerate a real, valid PNG image. - GET
https://api.testingapis.com/api/formats/rssReturn a sample RSS 2.0 feed with two itemsReturn a sample RSS 2.0 feed with two items. - GET
https://api.testingapis.com/api/formats/svgReturn a sample SVG imageReturn a sample SVG image. - GET
https://api.testingapis.com/api/formats/textReturn a sample plain-text documentReturn a sample plain-text document. - GET
https://api.testingapis.com/api/formats/tsvReturn the sample employee table as text/tab-separated-valuesReturn the sample employee table astext/tab-separated-values. - GET
https://api.testingapis.com/api/formats/wrong-content-typeReturn valid JSON mislabelled as text/htmlReturn valid JSON mislabelled astext/html. - GET
https://api.testingapis.com/api/formats/xmlReturn a sample user list as application/xmlReturn a sample user list asapplication/xml. - GET
https://api.testingapis.com/api/formats/yamlReturn a sample user object as application/yamlReturn a sample user object asapplication/yaml.
Example request
List every available format and special-case endpoint. Full reference and a Send button.
curl -X GET "https://api.testingapis.com/api/formats" \
-H "X-TestingApis-Key: YOUR_API_KEY"{
"formats": ["json", "xml", "… 15 more items"],
"special": ["jsonp?callback=fn", "negotiate", "… 10 more items"]
}Sign in to see the details
The parameters, request and response examples and the live Try it panel for these endpoints are for signed-in members. Accounts are free and take a few seconds to create.