# For a quick start check out our HTTP Requests collection (Tools|HTTP Client|Open HTTP Requests Collection).
#
# Following HTTP Request Live Templates are available:
# * 'gtrp' and 'gtr' create a GET request with or without query parameters;
# * 'ptr' and 'ptrp' create a POST request with a simple or parameter-like body;
# * 'mptr' and 'fptr' create a POST request to submit a form with a text or file field (multipart/form-data);


###
POST http://localhost:9900/api/user/auth/login
Content-Type: application/json

{
  "username": "admin",
  "password": "111111"
}

> {%

    client.test("Request executed successfully", function() {
        client.assert(response.status === 200, "Response status is not 200");
    });

    client.test("Headers option exists", function() {
        client.assert(response.headers.valuesOf("Set-Cookie")[0] != "", "Cannot find 'headers' option in response");
    });

    client.global.set("XTOKEN", response.headers.valuesOf("Set-Cookie")[0]);

    %}

###

GET http://localhost:9900/api/user/auth/info
Cookie: {{XTOKEN}}}

###

POST http://localhost:9900/api/user/auth/logout
Cookie: {{XTOKEN}}}

###