1
0
mirror of https://github.com/kevin1024/vcrpy.git synced 2025-12-09 09:13:23 +00:00
Commit Graph

8 Commits

Author SHA1 Message Date
Kevin McCarthy
5e295e0603 Serialize dict of lists, use dicts internally
There is a weird quirk in HTTP.  You can send the same header twice.
For this reason, headers are represented by a dict, with lists as the
values.  However, it appears that HTTPlib is completely incapable of
sending the same header twice.  This puts me in a weird position: I want
to be able to accurately represent HTTP headers in cassettes, but I
don't want the extra step of always having to do [0] in the general
case, i.e.  request.headers['key'][0]

In addition, some servers sometimes send the same header more than once,
and httplib *can* deal with this situation.

Futhermore, I wanted to keep the request and response cassette format as
similar as possible.

For this reason, in cassettes I keep a dict with lists as keys, but once
deserialized into VCR, I keep them as plain, naked dicts.
2014-05-03 17:39:12 -10:00
Max Shytikov
78f6ce46b5 Added test casses and refactored test for Request#port 2014-05-04 02:20:46 +02:00
Max Shytikov
1190a0e62e Removed default '80' port of uri in tests 2014-05-04 02:11:49 +02:00
Max Shytikov
61e3bdc402 Added tetst for uri and port of Request 2014-05-03 22:31:30 +02:00
Max Shytikov
eab10578d5 Make Request headers to be a dict of lists 2014-05-02 07:32:15 +02:00
Max Shytikov
edf1df9188 Replaced Request 'host, port, protocol, path' with 'uri' 2014-04-30 02:27:52 +02:00
Kevin McCarthy
c8299103fb pep8 fixes 2013-08-23 20:35:43 -10:00
Kevin McCarthy
ec01955c68 lets store the proto too 2013-08-11 15:05:41 -10:00