# http

## http

```bash
 -H | --http            HTTP actions ....
    |                   response: print response header of server
    |                   redirect: check if redirect id done or not
    |                   status: print status for the GET request
    |                   ttfb: print statistics about Time to First Byte
    |                   gzip: check if gzip is enabled or not
```

{% hint style="info" %}
actions for HTTP

* response (or res)
* redirect (or red)
* status
* ttfb (= Time to First Byte)
* gzip
  {% endhint %}

###

### response

check the response form the server

```bash
root[0]shakiba:/pp# curly --http res -d media.shakiba.net
HTTP/1.1 301 Moved Permanently
Server: nginx/1.14.0 (Ubuntu)
Date: Tue, 10 Nov 2020 12:33:44 GMT
Content-Type: text/html
Content-Length: 194
Connection: keep-alive
Location: https://media.shakiba.net/

HTTP/2 200
server: nginx/1.14.0 (Ubuntu)
date: Tue, 10 Nov 2020 12:33:44 GMT
content-type: text/html


option: http
action: response
status: OK

exit 0
root[0]shakiba:/pp#
```

###

### redirect

check redirection of a domain

```bash
root[0]shakiba:/pp# curly --http red -d media.shakiba.net
HTTP/1.1 301 Moved Permanently
Location: https://media.shakiba.net/
HTTP/2 200

option: http
action: redirect
status: OK

exit 0
root[0]shakiba:/pp#
```

###

### status

check status of the servers and more

```bash
root[0]shakiba:/pp# curly --http status -d media.shakiba.net
URL               https://media.shakiba.net/
status            200
remote_ip         185.8.172.233
remote_port       443
num_connects      2
num_redirects     1
scheme            HTTPS
http_version      2
ssl_verify_result 0

option: http
action: status
status: OK

exit 0
root[0]shakiba:/pp#
```

###

### ttfb

measure Time to First Byte&#x20;

```bash
root[0]shakiba:/pp# curly --http ttfb -d media.shakiba.net
url_effective       https://media.shakiba.net/
time_namelookupe    0.012499 | DNS lookup
time_connect        0.013454 | TCP connection
time_appconnect     0.049755 | App connection
time_redirect       0.005649 | Redirection time
time_starttransfer  0.057018 | TTFB
time_total          0.058207

option: http
action: ttfb
status: OK

exit 0
root[0]shakiba:/pp#
```

### gzip

check if gzip has been enabled or not

```bash
root[0]shakiba:/pp# curly --http gzip -d media.shakiba.net
         compressed        uncompressed  ratio uncompressed_name
               1173                3591  67.8% /tmp/curl
gzip is enabled

option: http
action: gzip
status: OK

exit 0
root[0]shakiba:/pp#
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.shakiba.net/tools/curly/http.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
