Formatos de resposta
Respostas fixas em todos os tipos de conteúdo comuns, mais negociação de conteúdo, corpos já comprimidos, charsets e conteúdos quebrados de propósito para testes negativos.
Sua conta libera estes endpoints. Use Try it na página de cada endpoint para enviar requisições.
Estes endpoints precisam de uma conta gratuita. Crie uma ou entre para ver os detalhes e testá-los aqui.
- 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.
Requisição de exemplo
List every available format and special-case endpoint. Referência completa e botão Send (em inglês).
cURL
curl -X GET "https://api.testingapis.com/api/formats"Resposta · 200 OK
{
"formats": ["json", "xml", "… 15 more items"],
"special": ["jsonp?callback=fn", "negotiate", "… 10 more items"]
}Entre para ver os detalhes
Os parâmetros, os exemplos de requisição e resposta e o painel Try it ao vivo de estes endpoints são para membros conectados. As contas são gratuitas e levam poucos segundos para criar.