content_type | R Documentation |
These are convenient wrappers aroud add_headers()
.
content_type(type)
content_type_json()
content_type_xml()
accept(type)
accept_json()
accept_xml()
type |
A mime type or a file extension. If a file extension (i.e. starts
with |
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.
## Not run:
GET("http://httpbin.org/headers")
GET("http://httpbin.org/headers", accept_json())
GET("http://httpbin.org/headers", accept("text/csv"))
GET("http://httpbin.org/headers", accept(".doc"))
GET("http://httpbin.org/headers", content_type_xml())
GET("http://httpbin.org/headers", content_type("text/csv"))
GET("http://httpbin.org/headers", content_type(".xml"))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.