Closed PietrH closed 2 months ago
Both check_opencpu_response()
and forward_to_api()
(via check_opencpu_response()
return the R error as they should and stop operation...
So while I can replicate the OpenCPU binary response with:
httr::POST(
url = "https://opencpu.lifewatch.be/library/etnservice/R/write_dwc/",
body = list(credentials = get_credentials(),
animal_project_code = "2014_demer",
directory = "."),
encode = "json"
)
I can't actually replicate the no error behaviour.
Was I getting a different error because of the 403 I was getting? (because functions needed to start with connect_
, get_
or list_
, now also write_
?
But even then the function should have returned an error with the message:
Error: API request failed: Client error: (403) Forbidden
Currently
check_opencpu_response()
only checks for the HTTP status code, but it could also check for the content type.During #297 , I encountered a case where the content type was binary causing
extract_temp_key()
to return NA without an error.Either of these functions should have thrown an error here instead.
The API response was binary because I was passing unsupported arguments to
etnservice
via the request body