To add a collaborator to this project you will need to use the Relish gem to add the collaborator via a terminal command. Soon you'll be able to also add collaborators here!More about adding a collaborator
around_http_request hook wraps each HTTP request. It can be used
rather than separate
to simplify wrapping/transactional logic (such as using a VCR cassette).
In your block, call
#proceed on the yielded request to cause it to continue.
Alternately, you can treat the request as a proc and pass it on to a method that
expects a block by prefixing it with an ampersand (
around_http_request will not work on Ruby 1.8. It uses a fiber
under the covers and thus is only available on interpreters that support fibers.
On 1.8, you can use separate
- globally handle requests using an around_http_request hook
a file named "globally_handle_requests.rb" with:
it should pass with:
Response for request 1: Response 1 Response for request 2: Response 1
- the file "cassettes/global.yml" should contain "Response 1"
Examples: configuration http_lib c.hook_into :webmock net/http c.hook_into :webmock httpclient c.hook_into :webmock curb c.hook_into :typhoeus typhoeus c.hook_into :excon excon c.hook_into :faraday faraday (w/ net_http)
Last published over 1 year ago by krainboltgreene.