Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTTP request in Ubuntu

i need to call a HTTP request in ubuntu how do i do it? I can't seem to find an answer around on how to to do it?

How do run the following url without calling a browser like lynx to do it?

http://www.smsggglobal.com/http-api.php?action=sendsms&user=asda&password=123123&&from=123123&to=1232&text=adsdad
like image 725
mister Avatar asked Apr 27 '12 20:04

mister


People also ask

How do I get HTTP request in Linux?

You can use either curl or wget command to send HTTP requests from UNIX or Linux operating system. Both commands allow you to send GET and POST requests, which means you can also call REST web services.

How do I request curl in Ubuntu?

Installing cURL for Ubuntu Linux Next, install cURL, execute: sudo apt install curl. Verify install of curl on Ubuntu by running: curl --version. Search for libcurl bindings for your programming needs: apt-cache search libcurl | grep python. Install the Python bindings to libcurl: sudo apt install python3-pycurl.

How do I monitor http requests in Linux?

Using tcpdump You can also use tcpdump command to capture all raw packets, on all interfaces, on all ports, and write them to file. Now when you run your browser or any application that makes HTTP requests, all the information will be logged in /tmp/http. log file.


2 Answers

in your command prompt, run the following:

curl http://www.smsggglobal.com/http-api.php?action=sendsms&user=asda&password=123123&&from=123123&to=1232&text=adsdad

the curl command executes an http request for a given url and parameters.

if you need to specify another HTTP method, use curl -X <TYPE> <URL>, like this:

curl -X POST http://www.smsggglobal.com/http-api.php?action=sendsms&user=asda&password=123123&&from=123123&to=1232&text=adsdad

curl documentation: http://curl.haxx.se/docs/manpage.html

like image 115
Kristian Avatar answered Sep 23 '22 18:09

Kristian


to display the results:

curl http://www.smsggglobal.com/http-api.php?action=sendsms&user=asda&password=123123&&from=123123&to=1232&text=adsdad

or

to save the results as a file

wget http://www.smsggglobal.com/http-api.php?action=sendsms&user=asda&password=123123&&from=123123&to=1232&text=adsdad
like image 45
AndresQ Avatar answered Sep 23 '22 18:09

AndresQ