Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

curl get example

curl -i -H "Accept: application/json" -H "Content-Type: application/json" -X GET http://hostname/resource
Comment

curl get return code

curl -I http://www.example.org
Comment

curl in api

curl is a command line client to send request and
get respond from command line, so it's basically 
it's just way to send a request and response. Where you
send it we call it client. But with postman we can do more
than just sending request end respond.
This tool is preferred for automation, 
since it is designed to work without user interaction.
curl can transfer multiple file at once.
Also A lot of API documentation provide curl
command for example when we run the request and
Postman can easily import curl command without you
manually typing the whole part of the request.
Comment

curl detailed response

curl -i google.de
Comment

Curl Get

public function sendSms($mobile)
{
  $message ='Your message';
  $url = 'www.your-domain.com/api.php?to='.$mobile.'&text='.$message;

     $ch = curl_init();
     curl_setopt($ch, CURLOPT_URL, $url);
     curl_setopt($ch, CURLOPT_POST, 0);
     curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

     $response = curl_exec ($ch);
     $err = curl_error($ch);  //if you need
     curl_close ($ch);
     return $response;
}
Comment

curl get request

curl -H "Accept: application/xml" -H "Content-Type: application/xml" -X GET http://hostname/resource
Comment

PREVIOUS NEXT
Code Example
Shell :: ubuntu 20 lts install node 10 
Shell :: linux process holding deleted file 
Shell :: httpd service centos 7 and centos 8 
Shell :: edit branch name git 
Shell :: generate keystore on mac 
Shell :: how to reverse a git pull 
Shell :: reset bash_profile 
Shell :: export requirements from python venv 
Shell :: Kali free ports 
Shell :: webmin restart 
Shell :: grep search for string in directory 
Shell :: how to install emotion in gatsby 
Shell :: how to install cuckoo sandbox 
Shell :: rails no migration with version number 
Shell :: find command 
Shell :: how to create a new file in kali linux 
Shell :: merge remote commits to local then push 
Shell :: bash read file into variable 
Shell :: youtube-dl ubuntu 
Shell :: manjaro nvidia driver 
Shell :: install next.js 
Shell :: navigate to a directory linux 
Shell :: edit cron jobs linux 
Shell :: show public ip 
Shell :: linux shell echo command with varia ble 
Shell :: error TS1056 
Shell :: bash float division 
Shell :: count lines in files 
Shell :: ubuntu no space left on device boot 
Shell :: list all user ubuntu server 
ADD CONTENT
Topic
Content
Source link
Name
9+7 =