Format response
Response tetap dalam setiap content type yang umum, ditambah content negotiation, body yang sudah dikompresi, charset, dan payload yang sengaja dirusak untuk pengujian negatif.
Akun Anda membuka endpoint ini. Pakai Try it di halaman tiap endpoint untuk mengirim request.
Endpoint ini butuh akun gratis. Buat akun atau masuk untuk melihat detailnya dan mencobanya di sini.
- 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.
Contoh request
List every available format and special-case endpoint. Referensi lengkap dan tombol Send (dalam bahasa Inggris).
cURL
curl -X GET "https://api.testingapis.com/api/formats"Response · 200 OK
{
"formats": ["json", "xml", "… 15 more items"],
"special": ["jsonp?callback=fn", "negotiate", "… 10 more items"]
}Masuk untuk melihat detailnya
Parameter, contoh request dan response, serta panel Try it langsung untuk endpoint ini khusus anggota yang sudah masuk. Akun gratis dan dibuat dalam beberapa detik.