CURL Command Online | How to Run a CURL command Online

CURL

    CURL stands for client URL.   It is free and open-source software. It runs on Linux, Mac, and Windows.
    A CURL is a command-line tool used to transfer data to and from a server and make various requests. It's a great tool for testing Rest API's downloading files and so on. CURL supports every protocol such as HTTP, HTTPS, FTP, POP3, and SMTP, etc. This tool is used for automation as it is designed to work without user interaction.
    CURL is one of the best tools when it comes to debugging network requests.

How to use the CURL command:

  • Check the curl version using the (--version) command, this command returns the version, supported protocols, and features of the present version. 
  • Download a file. To download a file, use the (-o) option with the curl. 
  • Renew a disrupted document. (-c) or ctrl + c  tells the curl to resume the interrupted document from the beginning.
  • Download various files such as info.html and about.html from yoursite.com and mysite.com
  • Combine your curl with xargs.com so you can download files from a list of URLs in a  file.
  • Make use of a proxy with or without authentication.
  • Interrogate HTTP  headers which allow the remote web server to send supplementary information with the actual request. 
  • Construct a POST request with parameters 
    • For example:- $ curl --data "firstName=Chrislin&lastName=CJ" https://yourdomain.com/info.php
  • Download and Upload files from the FTP server. 
  • State User-agent along with HTTP request and indicates which browser the client used to make.
  • Save website cookies using cnncookies.txt in your curl.
  • Alter the name resolution. Use --resolve command in your curl.
    • For example:- $ curl --resolve www.yourdomain.com:80:localhost http://www.yourdomain.com
  • Limit the download rate to 100KB/s using --limit-rate.

Run CURL command:

    For macOS and later versions of  Windows 10, CURL is already installed by default.

The following steps are required to download and install CURL if you have a version of Windows earlier than Windows 10.
  1. Create a new folder called curl in your C drive.
  2. Visit  http://curl.haxx.se/download.html and download one of the following zip files
    • For a 64-bit system, select the latest Win64iap zip version from the Win64-Generic section with SSL(Secure Socket Layer) support. 
    • For a 32-bit system, select the newest Win32 zip version from the Win32-Generic section with SSL support. 
  3. Unzip the downloaded file and move the curl.exe file to your C folder.
  4. Download the digital certificate file named cacert. pem from  http://curl.haxx.se/docs/caextract.html.
  5. Shift the cacert. pem to your C:\ curl folder and rename it curl-ca-bundle. crt.
  6. Append the curl folder path to your Windows PATH environment variable so that the curl command is available from any location at the command prompt.
    • In the Start menu, right-click on This PC and select More > Properties. 
    • From the Advanced System Settings, click the Environment Variables buttons on the lower right side.
    • Pick the "Path" variable in System variables, and click Edit.
    • Click New from the Edit Environment Variable dialog box and add the path to the curl.exe file.
    • Keep clicking OK to accept the change and close the dialog box.

CURL Ping:

    PING stands Packet Internet Groper.
    This command is used to check the network connectivity between the host and the server.
 This command takes the IP address or the URL as an input and dispatches a data packet to the defined address with the message "PING" and gets a response from a server/host and this time is recorded which is called latency. Fast ping low latency provides you a faster connection. Ping uses Internet Control Message Protocol to send an ICMP echo message to the defined server/host if that host is available then it sends ICMP to reply message.  It's measured in milliseconds.

Using Ping:-

    $ ping www.abc.com
    Use ctrl+c to stop pinging or else it will keep sending packets. 
    We can control the ping by using the -c option which defines the number of packets to be sent to the server/host.
For example $ ping -c  5  www.abc.com
    We can control the size of packets sent such as light or heavy packets by using the -s option.
For example: $ ping -s  30  -c  5 www.abc.com
    By default, ping waits for 1 sec to send the next package. To change the time interval -i option is used.
For example: $ ping  -i  2 www.abc.com
    -q option is used to get the summary about the network.
For example: $ ping -c  5  -q  www.abc.com 
    -w option helps you to stop ping after some time.
For example: $ ping -w  5  www.abc.com
This is will stop pinging after 5 seconds.
    To test network performance -the f option is used.
For example: $ ping -f  www.abc.com
    To fill data in packets, use -p option.
For example: $ ping -c  6  -p ff www.abc.com 

GET Method:

    GET is one of the most familiar HTTP requests. It is used to request data from a defined resource. Its request can be cached and bookmarked. 
    
    





Post a Comment

Previous Post Next Post