1

I have seen similar threads, but none were of help.

Anyway, whenever I try to run the following code:

> library(httr)

> test <-GET("https://olinda.bcb.gov.br/olinda/servico/taxaJuros/versao/v1/odata/TaxasJurosDiariaPorInicioPeriodo(InicioPeriodo=@InicioPeriodo)?%40InicioPeriodo=%2706-18-2018%27&%24format=json")

I get the error described in the title:

Error in curl::curl_fetch_memory(url, handle = handle) : 
  Failure when receiving data from the peer

It used to work until last Friday. I have updated R to version 3.5.1, curl to 3.2, RCurl 1.95-4.10 and httr to 1.3.1, the latest available. I have not succeeded with httr::RETRY.

So, what can be done to fix the issue?

1 Answer 1

2

I've found that using jsonlite::fromJSON() and wrapping the URL in url(), like so

jsonlite::fromJSON(url("https://olinda.bcb.gov.br/olinda/servico/taxaJuros/versao/v1/odata/TaxasJurosDiariaPorInicioPeriodo(InicioPeriodo=@InicioPeriodo)?%40InicioPeriodo=%2706-18-2018%27&%24format=json")

will yield the expected result.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.