]> khamidou — GitHub mirrors - vcrpy.git/commitdiff
update readme
authorKevin McCarthy <me@kevinmccarthy.org>
Mon, 12 Aug 2013 04:57:28 +0000 (18:57 -1000)
committerKevin McCarthy <me@kevinmccarthy.org>
Mon, 12 Aug 2013 04:57:28 +0000 (18:57 -1000)
README.md

index bc5c14a35f65bc2710984e1158f15a5cb82e8176..784ce94b2e4985b6a1eeb3df4c3956afb9b5f5ed 100644 (file)
--- a/README.md
+++ b/README.md
@@ -55,8 +55,8 @@ with vcr.use_cassette('fixtures/vcr_cassettes/synopsis.yaml') as cass:
     response = urllib2.urlopen('http://www.zombo.com/').read()
     # cass should have 1 request inside it
     assert len(cass) == 1 
-    # the request host should be zombo.com
-    assert cass.requests.keys()[0].host == 'zombo.com'
+    # the request url should have been http://www.zombo.com/
+    assert cass.requests[0].url == 'http://www.zombo.com/'
 ```
 
 The Cassette object exposes the following properties which I consider
@@ -72,6 +72,16 @@ part of the API.  The fields are as follows:
   response has been played back, indexed by the request
 * `response_of(request)`: Access the response for a given request.
 
+The Request object has the following properties
+
+  * `URL`: The full url of the request, including the protocol.  Example: "http://www.google.com/"
+  * `path`: The path of the request.  For example "/" or "/home.html"
+  * `host`: The host of the request, for example "www.google.com"
+  * `port`: The port the request was made on
+  * `method` : The method used to make the request, for example "GET" or "POST"
+  * `protocol`: The protocol used to make the request (http or https)
+  * `body`: The body of the request, usually empty except for POST / PUT / etc
+
 
 
 ##Installation