Antwortformate
Feste Antworten in allen gängigen Content-Types, dazu Content Negotiation, vorkomprimierte Bodies, Zeichensätze und absichtlich kaputte Inhalte für Negativtests.
Dein Konto schaltet diese Endpunkte frei. Nutze Try it auf der Seite jedes Endpunkts, um Requests zu senden.
Diese Endpunkte brauchen ein kostenloses Konto. Leg eins an oder melde dich an, um ihre Details zu sehen und sie hier auszuprobieren.
- 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.
Beispiel-Request
List every available format and special-case endpoint. Vollständige Referenz und Send-Button (auf Englisch).
cURL
curl -X GET "https://api.testingapis.com/api/formats"Antwort · 200 OK
{
"formats": ["json", "xml", "… 15 more items"],
"special": ["jsonp?callback=fn", "negotiate", "… 10 more items"]
}Melde dich an, um die Details zu sehen
Die Parameter, die Beispiele für Request und Antwort und das Live-Panel Try it für diese Endpunkte sind für angemeldete Mitglieder. Konten sind kostenlos und in wenigen Sekunden angelegt.