Re: convert Curl with headers -H and -- data to RestClient

Timothy Fong <timfong888@...>
 

I get the following error (I made some adjustments because of formatting):

RestClient::BadRequest: 400 Bad Request


September 30, 2014 at 2:33 PM
RestClient.post "https://api.sendhub.com/v1/messages/?username=NUMBER\&api_key=API", { 'contacts' => [1111], 'text' => 'Testing }.to_json, :content_typ
e => 'application/json'
I hope this works.



September 30, 2014 at 2:24 PM
How do I convert the following to Restclient?

curl -H "Content-Type: application/json" -X POST --data '{"contacts" : [1111],"text" : "Testing"}' https://api.sendhub.com/v1/messages/?username=NUMBER\&api_key=APIKEY
 

September 30, 2014 at 2:24 PM
How do I convert the following to Restclient?

curl -H "Content-Type: application/json" -X POST --data '{"contacts" : [1111],"text" : "Testing"}' https://api.sendhub.com/v1/messages/?username=NUMBER\&api_key=APIKEY
 


Join main@rest-client.groups.io to automatically receive all group messages.