type: A mime type or a file extension. If a file extension (i.e. starts with .) will guess the mime type using mime::guess_type().
Details
accept_json/accept_xml and content_type_json/content_type_xml are useful shortcuts to ask for json or xml responses or tell the server you are sending json/xml.