Skip to content

Commit

Permalink
Improved section about basic authentication support in readme.
Browse files Browse the repository at this point in the history
  • Loading branch information
Bartosz Blimke committed Dec 10, 2009
1 parent 4e0568a commit bb41263
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions README.md
Expand Up @@ -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

Expand Down

0 comments on commit bb41263

Please sign in to comment.