Home > Network Management > curl-verbose

curl-verbose: Detailed output of curl's communication

`curl-verbose` refers to the concept of using the `-v` or `--verbose` option with the `curl` command to display detailed information about the HTTP(S) request and response process. This mode allows you to obtain in-depth information about network communication, including DNS resolution, TCP connections, SSL/TLS handshakes, request headers, response headers, and data transfer, making it extremely useful for debugging and troubleshooting.

Overview

`curl-verbose` provides a detailed view of all stages of a network request through `curl`'s `-v` option. This is particularly useful for web service development, API testing, and network troubleshooting.

Key Output Information

When you run `curl -v`, you can see the following information:

  • DNS resolution process
  • TCP/IP connection attempts and success status
  • Detailed SSL/TLS handshake information (certificates, protocol versions, etc.)
  • HTTP request headers sent by the client
  • HTTP response headers received from the server
  • Data transfer process and speed

Key Options

`curl-verbose` refers to `curl`'s `-v` option, along with other commonly used `curl` options.

Verbose Output and Related Options

Generated command:

Try combining the commands.

Description:

`curl-verbose` Executes the command.

Combine the above options to virtually execute commands with AI.

Usage Examples

How to use `curl -v` to check detailed communication information in various scenarios.

Basic Verbose Output

curl -v https://example.com

Displays detailed information about the request and response to the specified URL.

Verbose Output with Response Headers

curl -v -i https://example.com/api/data

Displays the request/response process along with the server's response headers explicitly.

Verbose Output Following Redirects

curl -v -L http://bit.ly/example

For short URLs or URLs with redirects, displays detailed information including the redirection process.

Verbose Output Ignoring SSL Certificate

curl -v -k https://self-signed-test.com

When SSL/TLS verification errors occur due to self-signed certificates, this option ignores verification and displays detailed information.

Verbose Output for POST Request

curl -v -X POST -d "key=value&param=data" https://api.example.com/submit

Checks the detailed communication process for a POST request, including the data being sent.

Installation

`curl-verbose` is not a separate package; it's an option of the `curl` command. Therefore, if `curl` is installed, you can use it immediately. `curl` is pre-installed on most Linux distributions. If it's not installed, you can install it using the following commands.

Debian/Ubuntu

sudo apt update && sudo apt install curl

Install `curl` using the APT package manager.

CentOS/RHEL/Fedora

sudo yum install curl
# or
sudo dnf install curl

Install `curl` using the YUM or DNF package manager.

Arch Linux

sudo pacman -S curl

Install `curl` using the Pacman package manager.

Tips & Precautions

Tips and precautions for effectively using `curl -v`.

Filtering and Saving Output

Since verbose output contains a large amount of information, it's recommended to filter the necessary information or save it to a file for analysis.

  • Use with `grep` to search for specific keywords: `curl -v https://example.com 2>&1 | grep "SSL"`
  • Use with `less` to view page by page: `curl -v https://example.com 2>&1 | less`
  • Redirect output to a file: `curl -v https://example.com > curl_verbose_output.log 2>&1`

Security Precautions

Be cautious as verbose output may contain sensitive information.

  • Sensitive information such as API keys, authentication tokens, and session IDs may be included in headers or the body. Exercise caution when using in public places or shared environments.
  • The `-k` option, which bypasses SSL/TLS certificate verification, should only be used for development/debugging purposes and never in production environments.

Debugging Utility

This is a very powerful tool for diagnosing various network and web service-related issues, including network connection problems, SSL/TLS handshake errors, HTTP header issues, and redirect loops.


Same category commands