Permalink
Browse files

Updated README with information about request callbacks

  • Loading branch information...
1 parent 207443e commit 53311327b14252d16957e28b14d0a77cf0b0e4d9 Bartosz Blimke committed Jun 18, 2010
Showing with 14 additions and 0 deletions.
  1. +14 −0 README.md
View
@@ -412,6 +412,20 @@ i.e the following two sets of headers are equal:
To record your application's real HTTP interactions and replay them later in tests you can use [VCR](http://github.com/myronmarston/vcr) with WebMock.
+## Request callbacks
+
+####WebMock can invoke a callback for each, stubbed or real, request:
+
+ WebMock.after_request do |request_signature, response|
+ Log.info("Request #{request_signature} was made and #{response} was returned")
+ end
+
+#### invoke callbacks for real requests only and except requests made with Patron
+
+ WebMock.after_request(:except => [:patron], :real_requests_only => true) do |request_signature, response|
+ Log.info("Request #{request_signature} was made and #{response} was returned")
+ end
+
## Bugs and Issues
Please submit them here [http://github.com/bblimke/webmock/issues](http://github.com/bblimke/webmock/issues)

0 comments on commit 5331132

Please sign in to comment.