https://stackoverflow.com/questions/5957185/rest-client-ruby-gem-headers
@result = RestClient.post(
‘url‘,
{:billingSourceCode => "code"},
{:headers => {‘Content-Type‘ =>‘application/json‘,
"Authorization" => "key",
"Accept" => "application/json"},
{:cookies => {:session_id => "1234"}}
})
The params for the email is not in quotes. {"email": email@example.com, "password": password}.
hHeader = {"X-AppSecretToken" => ‘tokenID1_sanitized‘, "X-AgreementGrantToken" => ‘tokenID2_sanitized‘, "Content-Type" => ‘application/json‘}
hCustomer = RestClient.get("https://restapi.e-conomic.com/customers/5", hHeader) # => creates a response showing customer 5 (shown for example of GET)
body = {‘address‘ => ‘Example Street‘, ‘name‘ => ‘John Doe‘}.to_json
RestClient.post "https://restapi.e-conomic.com/customers/", body, hHeader)