Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected content type #128

Closed
orowley opened this issue Apr 16, 2024 · 4 comments
Closed

Unexpected content type #128

orowley opened this issue Apr 16, 2024 · 4 comments

Comments

@orowley
Copy link

orowley commented Apr 16, 2024

Kia Ora,

Wanting some assistance with the below error code when pulling data for a user defined json using the get_raster() function

Error in httr2::req_perform():
! Failed to parse error body with method defined in req_error().
Caused by error in httr2::resp_body_json():
! Unexpected content type "text/html".
• Expecting type "application/json" or suffix "json".

@giselamo
Copy link
Contributor

Hi @orowley Thank you for bringing this bug to our attention. Typically, this occurs when the request involves a large or intricate polygon, or encompasses multiple years or datasets (as illustrated in the example provided in the API errors section, see image attached.
Screenshot from 2024-04-16 11-21-47
). To help us investigate further, could you kindly provide the polygon and the specific request parameters you were using? Thanks!

@AndreaSanchezTapia
Copy link
Member

AndreaSanchezTapia commented Jun 21, 2024

Thanks for flagging this. I just encountered the same error with

get_event(event_type = "PORT_VISIT",
vessels = c("e0c9823749264a129d6b47a7aabce377",
"8c7304226-6c71-edbe-0b63-c246734b3c01"),
start_date = "2017-01-26",
end_date = "2017-12-31",
confidence = c(3, 4), # only for port visits
key = gfw_auth())

But the error solved itself when retrying later.

AndreaSanchezTapia added a commit that referenced this issue Jun 25, 2024
…e and Nate, comment the error parsing function, fixes #128, update README.Rmd to be more precise in explanations.
@AndreaSanchezTapia
Copy link
Member

Hi @orowley thanks for flagging this issue. The most recent version of the package will be released on June 30th and this should not happen again, so I'm closing this issue. Please feel free to reopen if you encounter it again after installing the next version.

@orowley
Copy link
Author

orowley commented Jun 27, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants