I'm using httr to retrieve data using api endpoints that pass through an authentication system.
I have to use httr::GET with the apiendopint ur, followed by httr::POST with my credentials.
e.g.
httr::GET('https://internalcompanyserver/apiendpoint_parameters')
and then
result <- httr::POST('https://internalcompanyserver/authentication, body = list(username, password), encode = 'form', httr::verbose())
This works fine.
But then when I want to retrieve data using a new set of parameters, the POST command with verbose set shows that it is querying the apiendpoint with the first set of parameters.
If I restart the R session, then run the GET and POST using the new set of parameters, it is fine.
Also, if I wait a sufficient amount of time (I didn't time it), something resets and I can then run GET and POST with the new set of parameters.
I need to be able to force a reset, because I am intending to user purrr::map to map through many parameter input changes to the apiendpoint.
Any assistance would be greatly appreciated.
Regards,
Ben