
In order to do a cURL on an IP address instead of a domain name or hostname, you can make use of the IP address instead.
curl http://xx.xx.xx.xx/sub-directory/
Example 1: IPv4 with default port 80:
$ curl http://127.0.0.1/tutorials/
The above example, will cURL to default port 80 and connect to the IP of localhost i.e. 127.0.0.1
In order to cURL to an IPv6 address, you will need to provide the IPv6 address inside square brackets,
Example 2: IPv6 with default port 80:
$ curl http://[::1]/tutorials/
Again the above will connect to the localhost at port 80.
Let's see some examples with a non-custom port like 8080,
Example 3: IPv4 with port 8080$ curl http://192.168.1.125:8080/tutorials/
Example 4: IPv6 with port 8090
$ curl http://[::ffff:c0a8:7d]:8090/tutorials/
-
Facing issues? Have Questions? Post them here! I am happy to answer!
More Posts related to cURL,
- Hide cURL Outputs and Errors on Terminal
- cURL DELETE Request with Examples
- Downloading Google Chrome using cURL Command
- List of 28 Protocols supported by cURL with Examples
- Get the Size of HTTP Response using cURL Command (Content Length)
- How to convert a Postman request to cURL Command
- How to URL Encode Data for a cURL Request Parameters
- Get cURL command from Chrome Inspect Network HTTP URL
- Fetch only content-type using cURL Command
- cURL -d Option with Examples
- cURL Option to show HTTP Response Status Code
- URL Encode cURL HTTP GET\POST Data with Examples
- How to get cURL Command to run in verbose mode?
- trurl: A new command-line tool for URL parsing and manipulation by cURL Developer
- [fix] command not found curl
- How to Pretty Print cURL JSON Output in Terminal
- Capture cURL Request Output to a File
- List of common cURL Error Codes
- How to pass authorization header using cURL
- Perform Basic Authentication using cURL with Examples
- Trace using cURL Command Example
- Efficient way to perform HTTP cURL GET/POST Requests with Payload
- Save cURL Command Output to a external file
- cURL Example using IP (IPv4 and IPv6) address and Port
- How to follow redirects in cURL Command Request
More Posts:
- How to get query string in JavaScript HTML location.search - JavaScript
- How to change default macOS Terminal Window size - MacOS
- #YouMakeStrayKidsStay STRAY KIDS EVERYWHERE ALL AROUND THE WORLD Trending Hashtag - News
- TextEdit save file with txt extension - MacOS
- Python: How to create a Dictionary of Lists with Examples - Python
- Bash Command to Check Disk Space - Bash
- How to Word wrap eclipse console logs width - Eclipse
- How to Uninstall Vim on Mac? - vi