http_type: Extract the content type of a response

Description Usage Arguments Value Examples

View source: R/response-type.R

Description

Extract the content type of a response

Usage

1

Arguments

x

A response

Value

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

Examples

1
2
3
4
5
6
7
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"]]

r-lib/httr documentation built on June 6, 2018, 9:32 p.m.