Method: Brine::Requesting#send_request

Defined in:
lib/brine/requesting.rb

#send_request(method, url) ⇒ Object

Send a ‘method` request to `url` including any current builder options and store response.

The response will be available as the ‘#response` property.

For requests such as simple GETs that only require a url this method may be self-contained; for more complex requests the values collected through request building are likely required. Any data present from the builder methods will always be inclued in the request and therefore such data should be cleared using ‘#reset_request` if it is not desired.

Parameters:

  • method (Symbol)

    Provide the HTTP method for the request such as returned by #parse_method.

  • url (String)

    Specify the url to which the request will be sent.



104
105
106
107
108
# File 'lib/brine/requesting.rb', line 104

def send_request(method, url)
  @response = client.run_request(method, url, @body, headers) do |req|
    req.params = request_params
  end
end