0

I want to simulate a request of the form curl -d "param = value" "http://ip:port?key1=value1&key2=value2" using the REST API Testing, but unfortunately I do not know how. More details about the -d flag can be found here.

If I use POST for the method type then I get a 405 error and if I use GET for the method type then I get a 404 error. From the command line the command works perfectly and I am able to receive the answer, but I do not know how to adjust the snippet -d "param = value" in a HTTP request.

I really appreciate any kind of help !!!

randomir
  • 17,989
  • 1
  • 40
  • 55
dorinmoldovan
  • 89
  • 2
  • 7
  • Simulate `curl -d` in **which language or environment**? Also, post here your attempts that are not producing the expected results. – randomir Oct 19 '17 at 12:07
  • Thank you for the answer !!! The detailed request looks like this `curl -d "input.string = a b c a b see" 'localhost:8090/jobs?appName=test&classPath=spark.jobserver.WordCountExample'` and is taken from [spark-jobserver](https://github.com/spark-jobserver/spark-jobserver). I would like to simulate `curl -d` in **Java** but as a HTTP request. More specifically, I do not know how to add the parameter `"input.string = a b c a b see"` in the message. – dorinmoldovan Oct 19 '17 at 12:22
  • I found [this](https://stackoverflow.com/questions/33310075/convert-curl-to-java-equivalent) post very helpful. Thank you again for your support !!! – dorinmoldovan Oct 19 '17 at 14:00

0 Answers0