Skip to content

Don't attempt to decode documents in ecp.request

Duncan Macleod requested to merge no-decode-documents into master

This PR fixes #4 (closed) by just returning whatever the response is from the HTTP request, rather than attempting to decode the object. This means that binary documents (e.g. PDF) can be written directly to local files with something along the lines of

from ligo.org import request
with open('LIGO-T970130.pdf', 'wb') as f:
    f.write(request('https://dcc.ligo.org/DocDB/0000/T970130/001/T970130-v1.pdf'))

This might also mean that users have to do a minimal amount of extra post-processing for simple text data, compared to what they would do before.

[@SeanDS]

Merge request reports