2

I want to send parameters with a POST request using the RestClient gem (but I don't want to pass the params as JSON).

In a GET request, I would have:

url = "http://example.com?param1=foo&param2=bar"
RestClient.get url 

How can I pass the same params but in a POST request without passing a JSON ?

Graham Slick
  • 6,692
  • 9
  • 51
  • 87

1 Answers1

2

Read ReadMe file of Rest-client git, it has lots of examples showing different types of request.

For your answer, try :

url = "http://example.com"
RestClient.post url,:param1=>foo, :param2=>bar
Ravi Shankar Bharti
  • 8,922
  • 5
  • 28
  • 52