Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

http_type

Extract the content type of a response


Description

Extract the content type of a response

Usage

http_type(x)

Arguments

x

A response

Value

A string giving the complete mime type, with all parameters stripped off.

Examples

r1 <- GET("http://httpbin.org/image/png")
http_type(r1)
headers(r1)[["Content-Type"]]

r2 <- GET("http://httpbin.org/ip")
http_type(r2)
headers(r2)[["Content-Type"]]

httr

Tools for Working with URLs and HTTP

v1.4.2
MIT + file LICENSE
Authors
Hadley Wickham [aut, cre], RStudio [cph]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.