Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added information about dynamic responses to README

  • Loading branch information...
commit 4e0568aac45c6be566dbb07be1eab5f887eec578 1 parent 9f0b338
Bartosz Blimke authored
Showing with 7 additions and 0 deletions.
  1. +7 −0 README.md
View
7 README.md
@@ -88,6 +88,13 @@ You can also use WebMock without RSpec or Test::Unit support:
Net::HTTP.get('www.google.com', '/') # ===> "abc\n"
+### Custom response with dynamically evaluated response
+
+ stub_request(:any, 'www.example.net').
+ to_return(:body => lambda { |request| request.body })
+
+ RestClient.post('www.example.net', 'abc') # ===> "abc\n"
+
### Request with basic authentication
stub_request(:any, "john:smith@www.google.com")
Please sign in to comment.
Something went wrong with that request. Please try again.