[API-users] Download request content type mismatch

Doug Palmer Doug.Palmer at csiro.au
Thu May 11 03:37:39 CEST 2017


I've been have some troubles using the groovy http builder to queue a 
download. I've eventually realised that what is happening is that the 
GBIF API is returning a download key as a simple text string but setting 
the content type to application/json. This causes difficulties with the 
http builder, since by default it tries to be helpful and parse the 
result as JSON. It then throws an exception, since it tries to interpret 
something like 0065397-160910150852091 as a number. (The 
/occurrence/count path also just returns a count, but this is correctly 
interpreted as just being an integer.)

I've worked around this problem, but could future versions of the API 
always return valid JSON for application/json content?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gbif.org/pipermail/api-users/attachments/20170511/d3ef63dc/attachment.html>

More information about the API-users mailing list