That's good to know about when to auto-parse and when not to. There is quite a
big stable of tools to check the response before you try to read...
> httr::http_error(r1)
[1] FALSE
> httr::http_status(r1)
$category
[1] "Success"
$reason
[1] "OK"
$message
[1] "Success: (200) OK"
and
> httr::h
Thanks to all that replied. I had just looked through the httr code and sure
enough for a .csv mime time it calls readr::read_csv(). The httr::content docs
suggest not using automatic parsing in a package, rather to determine mime
type and parse yourself and Ben's suggestion also works if I d
You can suppress all messages from that command with
junk <- suppressMessages(httr::content(r1))
If you only want to suppress that specific message you can use
withCallingHandlers:
junk <- withCallingHandlers(
httr::content(r1),
message=function(e){
if (grepl("P
Ahoy!
That's a message generated by the readr::read_table() function (or it's
friends). You can suppress it a number of ways, but this should work as
httr::content() will pass through arguments, like col_types = cols(), to the
file reader.
junk <- httr::content(r1, col_types = cols())
See mo
> On Jan 2, 2018, at 9:30 AM, Roy Mendelssohn - NOAA Federal
> wrote:
>
> Hi All:
>
> I am using httr to download files form a service, in this case a .csv file.
> When I use httr::content on the result, I get a message. Since this will be
> in a package. I want to suppress the message,
Hi All:
I am using httr to download files form a service, in this case a .csv file.
When I use httr::content on the result, I get a message. Since this will be
in a package. I want to suppress the message, but haven't figured out how to
do so.
The following should reproduce the result:
m
6 matches
Mail list logo