http_type

0th

Percentile

Extract the content type of a response

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.

Aliases
  • http_type
Examples
# NOT RUN {
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"]]
# }
Documentation reproduced from package httr, version 1.4.0, License: MIT + file LICENSE

Community examples

Looks like there are no examples yet.