Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Calling REST WS from command line

I read that REST WS can be called from a command line. I know that they can be invoked from program code, but how directly from command line? I looked around the internet to know how this can be done, but didn't find any information on this. Can anyone please tell me how this can be done? I have developed a rest ws app in grails.

like image 279
Shenoy Tinny Avatar asked Feb 24 '23 09:02

Shenoy Tinny


1 Answers

You can use curl from the commandline of any unix-like os.

For example, you can test some sample Facebook API like this:

curl https://graph.facebook.com/19292868552

or to POST:

curl -X POST -d "param1=value1&param2=value2" http://example.com/resource.cgi

like image 148
Ryan Her Avatar answered Mar 05 '23 06:03

Ryan Her