cjstehno / ersatz

🤖 A simulated HTTP server for testing client code with configurable responses.
https://cjstehno.github.io/ersatz
Apache License 2.0
47 stars 5 forks source link

Better support for downloading binary content #91

Closed cjstehno closed 4 years ago

cjstehno commented 6 years ago

Test scenario:

Download a zip file from server and open with ZipFile and read contents. The file should be downloaded with a GET and should have

content(data.bytes, 'application/zip')
header('Content-Disposition', 'attachment; filename="data.zip"')

This seems overly difficult to implement with existing code.

cjstehno commented 6 years ago

Supporting this will entail some deep changes in the way I handle the response content - it is for the better, but it will probably modify API interfaces unless I can come up with some means of supporting a graceful transition. I am shelving this until 1.8 or 2.0 release.

Some notes are in the response-bytes branch.

cjstehno commented 5 years ago

This will need to be part of 2.0 as originally specified since I will need to change the internal response storage to a byte array.

cjstehno commented 4 years ago

This has been implemented in v2.0, which is the next release.