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 time response

# -s, --silent
# Silent  or  quiet  mode.  
# Don't  show progress meter or error messages.  
# Makes Curl mute. 
# It will still output the data you ask for.
curl 
        --output /dev/null 
        --silent 
        --write-out '%{time_namelookup}' 
        https://google.com
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 :: openvpn client docker 
Shell :: install anydesk to kali 
Shell :: firebase cli 
Shell :: install document viewer ubuntu 
Shell :: snapcraft 
Shell :: install kube-vip 
Shell :: shopware 6 build storefront 
Shell :: download svn 
Shell :: Check Firewall setup 
Shell :: how to ignore .idea folder in gitignore 
Shell :: how to remove first colum froim file linux 
Shell :: bison install in kali linux 
Shell :: bash command to move all files to a dir 
Shell :: fix pvc pending kubernetes 
Shell :: git get remote branch 
Shell :: git local branch track remote 
Shell :: mac change file created file changed 
Shell :: sed repeat pattern 
Shell :: cli50 docs 
Shell :: bash add default argument 
Shell :: Make a backup of the database with SSH 
Shell :: xargs curl url 
Shell :: mv folder linux 
Shell :: Redirect output from within the shell script 
Shell :: install composer v2 ubuntu 
Shell :: bash for in loop 
Shell :: View Commit History With Changes in git command 
Shell :: set up vim in zsh 
Shell :: create json from terminal 
Shell :: odoo 14 install ubuntu 20.04 
ADD CONTENT
Topic
Content
Source link
Name
6+9 =