Sunday, 18 August 2019

HTTPie: Prompt for the password

If you provide only user name while accessing the secure API, HTTPie prompt you for the password.

Syntax
http -a {userName} {HTTP_METHOD} URL

$http -a krishna POST http://localhost:8080/api/v1/employees firstName=Krishna lastName=Gurram
http: password for krishna@localhost:8080: 
HTTP/1.1 201 
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Content-Type: application/json;charset=UTF-8
Date: Fri, 02 Aug 2019 15:25:22 GMT
Expires: 0
Pragma: no-cache
Set-Cookie: JSESSIONID=429D5B133F1A5F4C15BD23C3939F0BD9; Path=/; HttpOnly
Transfer-Encoding: chunked
X-Content-Type-Options: nosniff
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block

{
    "firstName": "Krishna",
    "id": 6,
    "lastName": "Gurram"
}



Previous                                                    Next                                                    Home

No comments:

Post a Comment