vcrpy icon indicating copy to clipboard operation
vcrpy copied to clipboard

Enable a VCR TransportAdapter plugin to HTTPie

Open bobh66 opened this issue 6 years ago • 1 comments

I'm working on a VCRpy TransportAdapter plugin for HTTPie (https://httpie.org/) which will allow users to record REST API interactions using the http command line client.

The work is basically done but there is one problem. HTTPie defaults to displaying the response body and headers, including the HTTP version information from the raw response.

Since VCRpy does not save the HTTP version from the raw response (it explicitly sets version to None in the VCRHTTPResponse class), when http tries to format the response headers it raises a KeyError exception. The VCRpy portion of the plugin works fine, and it you run http with the "-b" option to exclude the header output, there is no problem at all.

I'd like to submit a PR to VCRpy to add the HTTP version in the stored record to enable HTTPie to format the header output. As far as I can tell it's a two-line change, but it does change the stored record format.

Any thoughts? The VCR TransportAdapter plugin to HTTPie is really useful to record API interactions manually, so it would be nice to be able to release it without the header output issue.

Thanks,

Bob

bobh66 avatar Apr 10 '19 12:04 bobh66

A lot of changes have happened to VCRpy since this ticket was opened. As this ticket has become stale, would you mind closing it if it is no longer needed / relevant?

If I haven't heard anything in a week I'll mark it as closed as we have a lot of old tickets that need to be groomed to make it easier to see what is still relevant.

However if it is still needed, please feel free to re-open or create a new ticket.

Thanks! 🙏

neozenith avatar Jan 05 '20 23:01 neozenith