Sunday, 18 August 2019

HTTPie: Short cut of localhost


Instead of writing http://localhost:8080, you can write :8080.

$http :8080/public/v1/guests
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 12:12:16 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": 5,
        "lastName": "gurram"
    },
    {
        "firstName": "ram",
        "id": 6,
        "lastName": "gurram"
    },
    {
        "firstName": "ram",
        "id": 7,
        "lastName": "ponnam"
    }
]

Note
If the port is omitted, then 80 is assumed as port.

Example
http :/public/v1/guests



Previous                                                    Next                                                    Home

No comments:

Post a Comment