Skip to content

Conversation

@anthonybaxter
Copy link

https://data.csiro.au/dap/ws/v2/collections is an example of a server that sends back JSON rather than XML to a sickle request by default.

Adding headers={'Accept': 'application/xml'} to the Sickle() constructor fixes that, but it was a bit of digging to work out why. This logging message would have saved me a bit of debugging time.

https://data.csiro.au/dap/ws/v2/collections is an example of a server that sends back JSON rather than XML to a sickle request by
default.

Adding headers={'Accept': 'application/xml'} to the Sickle() constructor fixes that, but it was a bit of digging to work out why. This
logging message would have saved me a bit of debugging time.
@anthonybaxter
Copy link
Author

Hm. further adventures suggest
if (self.http_response.headers.get('Content-Type').split(";")[0] .lower()
not in ('text/xml', 'application/xml')):
is more robust.

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

Successfully merging this pull request may close these issues.

1 participant