Permalink
Browse files

Improved section about basic authentication support in readme.

  • Loading branch information...
1 parent 4e0568a commit bb4126353e8cf4a00961b1fb80b26c396bbaa35a Bartosz Blimke committed Dec 10, 2009
Showing with 7 additions and 3 deletions.
  1. +7 −3 README.md
View
@@ -97,9 +97,13 @@ You can also use WebMock without RSpec or Test::Unit support:
### Request with basic authentication
- stub_request(:any, "john:smith@www.google.com")
-
- Net::HTTP.get(URI.parse('http://john:smith@www.google.com')) # ===> Success
+ stub_request(:get, "user:pass@www.google.com")
+
+ Net::HTTP.start('www.google.com') {|http|
+ req = Net::HTTP::Get.new('/')
+ req.basic_auth 'user', 'pass'
+ http.request(req)
+ } # ===> Success
### Matching uris using regular expressions

0 comments on commit bb41263

Please sign in to comment.