Method: FileboundClient::Client#post

Defined in:
lib/filebound_client.rb

#post(url, query_params = nil, body = nil) ⇒ Hash

Executes a POST request on the current Filebound client session expecting JSON in the body of the request/response

Parameters:

  • url (String)

    the resource url to request

  • query_params (Hash) (defaults to: nil)

    the optional query parameters to pass to the POST request

  • body (Hash) (defaults to: nil)

    the hash that will be converted to JSON when inserted in the body of the request

Returns:

  • (Hash)

    the JSON parsed hash of the response body



71
72
73
74
# File 'lib/filebound_client.rb', line 71

def post(url, query_params = nil, body = nil)
  params = { headers: { 'Content-Type' => 'application/json' }, query: query_params, body: body }
  JSON.parse(perform('post', url, params), symbolize_names: true, quirks_mode: true)
end