Class: HTTP::Request

Inherits:
Object
  • Object
show all
Defined in:
lib/webmock/http_lib_adapters/http_rb/request.rb

Instance Method Summary collapse

Instance Method Details

#webmock_signatureObject



3
4
5
6
7
8
9
10
11
12
13
14
# File 'lib/webmock/http_lib_adapters/http_rb/request.rb', line 3

def webmock_signature
  request_body = if defined?(HTTP::Request::Body)
                   ''.tap { |string| body.each { |part| string << part } }
                 else
                   body
                 end

  ::WebMock::RequestSignature.new(verb, uri.to_s, {
    headers: headers.to_h,
    body: request_body
  })
end