I am trying to reproduce a curl request using the Restclient Ruby stone, and so far I have had a lot of problems trying to send the payload. My curl request looks something like this.
curl URL -X POST -u API_KEY -d '{"param_1": "1"}'
I am trying to replicate this using RestClient using something like this:
RestClient::Request.execute(method: :post, url: URL, user: API_KEY, payload: {"param_1" => "1"})
Alas, I keep getting 400 errors - Bad Requests at the same time. Am I sending data differently? Should I use something other than the payload?
source share