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

24 Commits

Author SHA1 Message Date
Ivan Malison
6602a449b1 Add support for posting files through requests. closes #121. Possibly #134. 2015-03-24 14:11:16 -07:00
Abhinav Gupta
2473bdb77a Fix default port for HTTPS. 2015-02-23 23:37:04 -08:00
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
3322234b25 Updated Request with stup to support default ports 2014-05-04 02:12:38 +02:00
Max Shytikov
5d1f35973d Make code 2.6 compatible 2014-05-02 07:32:17 +02:00
Max Shytikov
eab10578d5 Make Request headers to be a dict of lists 2014-05-02 07:32:15 +02:00
Max Shytikov
e4d1db0617 Removed frozenset 2014-04-30 02:38:01 +02:00
Max Shytikov
7e677f516d Deleted unnecessary __hash__ method of Request 2014-04-30 02:36:27 +02:00
Max Shytikov
1e995c3c9b Replaced yaml dump of Request object with plain dict dump 2014-04-30 02:36:26 +02:00
Max Shytikov
96d8782d08 Added 'protocol' to Request for backwards compatibility 2014-04-30 02:31:11 +02:00
Max Shytikov
4267828a3e Added 'scheme' to Request with matcher and test 2014-04-30 02:29:25 +02:00
Max Shytikov
9b188e986f Added query to Request with matcher and test 2014-04-30 02:27:52 +02:00
Max Shytikov
6b060e5666 Added path to Request with matcher and test 2014-04-30 02:27:52 +02:00
Max Shytikov
bd9fa773e8 Added port to Request with matcher and test 2014-04-30 02:27:52 +02:00
Max Shytikov
18ec57fa73 Added test and impl for Request 'host' attribute 2014-04-30 02:27:52 +02:00
Max Shytikov
edf1df9188 Replaced Request 'host, port, protocol, path' with 'uri' 2014-04-30 02:27:52 +02:00
Kevin McCarthy
e84cd6f059 Major Refactor of Stubs
So the stubs were getting out of hand, and while trying to add support for the
putrequest and putheader methods, I had an idea for a cleaner way to handle
the stubs using the VCRHTTPConnection more as a proxy object.  So
VCRHTTPConnection and VCRHTTPSConnection no longer inherit from HTTPConnection
and HTTPSConnection.  This allowed me to get rid of quite a bit of
copy-and-pasted stdlib code.
2014-03-08 19:22:58 -10:00
Kevin McCarthy
c8299103fb pep8 fixes 2013-08-23 20:35:43 -10:00
shu zOMG chen
51f0f1bacd Adding json serializer 2013-08-19 19:49:05 -10:00
Kevin McCarthy
a6c59c20d2 remove debugging code from Request and add repr 2013-08-11 17:51:33 -10:00
Kevin McCarthy
ec01955c68 lets store the proto too 2013-08-11 15:05:41 -10:00
Kevin McCarthy
59567a26cc lets make url the actual url instead of just the path 2013-08-11 15:05:41 -10:00
Kevin McCarthy
9ac03c889a hold counts in a Counter 2013-08-11 15:05:40 -10:00
Kevin McCarthy
87d27a7199 add requests class to sow the seeds of a custom matcher 2013-08-11 15:05:40 -10:00