Sunday, 18 August 2019

HTTPie: Verbose output, Print the whole request as well as the response

'-v' or '--verbose' option is used to print Verbose output. It Print the whole request as well as the response. Also print any intermediary requests/responses (such as redirects).

Example
$http -v POST http://localhost:8080/public/v1/guests/ firstName=rashika lastName=gun
POST /public/v1/guests/ HTTP/1.1
Accept: application/json, */*
Accept-Encoding: gzip, deflate
Connection: keep-alive
Content-Length: 43
Content-Type: application/json
Host: localhost:8080
User-Agent: HTTPie/1.0.2

{
    "firstName": "rashika",
    "lastName": "gun"
}

HTTP/1.1 200 
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Content-Type: application/json;charset=UTF-8
Date: Fri, 02 Aug 2019 11:50:36 GMT
Expires: 0
Pragma: no-cache
Transfer-Encoding: chunked
X-Content-Type-Options: nosniff
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block

{
    "firstName": "rashika",
    "id": 8,
    "lastName": "gun"
}


Previous                                                    Next                                                    Home

No comments:

Post a Comment