Response Formats¶
text/html¶
curl -H "Accept: text/html" -H "User-Agent: Agent Awesome" "httpconsole.com/agent"
Response:
HTTP/1.1 200 OK
Date: Wed, 02 Apr 2014 18:39:48 GMT
Transfer-Encoding: chunked
Content-Type: text/html
<!DOCTYPE html>
<html>
...
</html>
text/plain¶
curl -H "Accept: text/plain" -H "User-Agent: Agent Awesome" "httpconsole.com/agent"
Response:
HTTP/1.1 200 OK
Date: Wed, 02 Apr 2014 18:39:48 GMT
Transfer-Encoding: chunked
Content-Type: text/plain
Agent Awesome
application/php¶
curl -H "Accept: application/php" -H "User-Agent: Agent Awesome" "httpconsole.com/agent"
Response:
HTTP/1.1 200 OK
Date: Wed, 02 Apr 2014 18:39:48 GMT
Transfer-Encoding: chunked
Content-Type: application/php
a:1:{s:10:"user-agent";s:13:"Agent Awesome";}
application/xml¶
curl -H "Accept: application/xml" -H "User-Agent: Agent Awesome" "httpconsole.com/agent"
Response:
HTTP/1.1 200 OK
Date: Wed, 02 Apr 2014 18:39:48 GMT
Transfer-Encoding: chunked
Content-Type: application/xml
<?xml version="1.0" encoding="utf-8"?>
<response><user-agent>Agent Awesome</user-agent></response>
application/json¶
curl -H "Accept: application/json" -H "User-Agent: Agent Awesome" "httpconsole.com/agent"
Response:
HTTP/1.1 200 OK
Date: Wed, 02 Apr 2014 18:39:48 GMT
Transfer-Encoding: chunked
Content-Type: application/json
{"user-agent":"Agent Awesome"}