betamaxpy / betamax

A VCR imitation designed only for python-requests.
https://betamax.readthedocs.io/en/latest/
Other
566 stars 62 forks source link

send_and_request method does not honor stream argument #77

Closed itsmemattchung closed 8 years ago

itsmemattchung commented 8 years ago

Is there a specific reason that stream argument is hard coded to True ?

Ran across this when adding docstrings in this pull request https://github.com/sigmavirus24/betamax/pull/76

https://github.com/sigmavirus24/betamax/blob/master/betamax/adapter.py#L97-L101

sigmavirus24 commented 8 years ago

Yes. We also default stream to True because we always want to be able to retrieve the body of the request exactly as it came across the wire. This allows the Content-Encoding header to be stored without modification in the case where the request body is compressed. It preserves data integrity and allows us to implement other features (preserve_exact_body_bytes) with far less friction and far simpler logic.

itsmemattchung commented 8 years ago

Cool thanks for the explanation @sigmavirus24