Formatos de respuesta
Respuestas fijas en todos los tipos de contenido habituales, además de negociación de contenido, cuerpos ya comprimidos, juegos de caracteres y contenidos rotos a propósito para pruebas negativas.
Tu cuenta desbloquea estos endpoints. Usa Try it en la página de cada endpoint para enviar peticiones.
Estos endpoints necesitan una cuenta gratuita. Crea una o inicia sesión para ver sus detalles y probarlos aquí.
- 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.
Petición de ejemplo
List every available format and special-case endpoint. Referencia completa y botón Send (en inglés).
cURL
curl -X GET "https://api.testingapis.com/api/formats"Respuesta · 200 OK
{
"formats": ["json", "xml", "… 15 more items"],
"special": ["jsonp?callback=fn", "negotiate", "… 10 more items"]
}Inicia sesión para ver los detalles
Los parámetros, los ejemplos de petición y respuesta y el panel Try it en vivo de estos endpoints son para miembros con sesión iniciada. Las cuentas son gratuitas y se crean en unos segundos.