content

0th

Percentile

Extract content from a request.

There are currently three ways to retrieve the contents of a request: as a raw object, content, as a character vector, text_content, and as parsed into an R object where possible, parsed_content.

Usage
content(x)

text_content(x)

parsed_content(x, ...)

Arguments
...
additional parameters passed to conversion function
x
request object
Details

parsed_content currently knows about the following mime types:

See Also

Other response methods: response, stop_for_status

Aliases
  • content
  • parsed_content
  • text_content
Examples
r <- POST("http://httpbin.org/post", body = list(a = 1, b = 2))
content(r) # binary content
cat(text_content(r), "\n") # text content
parsed_content(r) # json converted to an R object

rlogo <- parsed_content(GET("http://cran.r-project.org/Rlogo.jpg"))
plot(0:1, 0:1, type = "n")
rasterImage(rlogo, 0, 0, 1, 1)
Documentation reproduced from package httr, version 0.1.1, License: MIT

Community examples

Looks like there are no examples yet.