Pass R parameters in an api with Post method?

Asked

Viewed 164 times

1

Friends, I created an R api using Plumber with the post method. but when it comes to calling this api and passing the parameters I’m not getting , I call this way:

resp <- POST("http:url", body = list(datainicio = '2018-07-23' , datafim = '2018-07-24'), encode = 'json')
r1 <- httr::content(resp, 'text')

and the error returned is :

[1] "{ "error ":[ "404 - Resource Not Found\"]}".

Thank you

  • This error in general does not mean that you are passing the data the wrong way, but that the endpoint was not found.

  • 1

    Thanks @Danielfalbel . You’re right. Later I discovered that there were firewalls prevented the transaction.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.