class HTTP::Connection

def send_request(req)

Returns:
  • (nil) -

Parameters:
  • Request (Request) -- to send to the server
def send_request(req)
  if @pending_response
    fail StateError, "Tried to send a request while one is pending already. Make sure you read off the body."
  elsif @pending_request
    fail StateError, "Tried to send a request while a response is pending. Make sure you've fully read the body from the request."
  end
  @pending_request = true
  req.stream @socket
  @pending_response = true
  @pending_request  = false
end