Class: Twirbet::Transports::NetHTTPTransport

Inherits:
Object
  • Object
show all
Extended by:
T::Sig
Includes:
Twirbet::Transport
Defined in:
lib/twirbet/transports/net_http_transport.rb

Instance Method Summary collapse

Instance Method Details

#call(request) ⇒ Object



14
15
16
17
# File 'lib/twirbet/transports/net_http_transport.rb', line 14

def call(request)
  response = T.cast(Net::HTTP.post(URI(request.url), request.body, request.headers), Net::HTTPResponse)
  Transport::Response.new(response.code.to_i, response.to_hash, response.body)
end