Creates a new authentication cookie.

Request syntax

POST /2019-09-30/auth/cookies
Authorization: Authorization

Request parameters

Parameter Type Required Description
Authorization String Yes The Basic authentication information. The format is Basic base64(username:password).

For example, the value of the parameter can be Basic Y2h5aW5n********NTY=.

Response syntax

HTTP/1.1 StatusCode
Set-Cookie: Cookie
Content-Type: application/json

Payload

Response Parameters

Parameter Type Description
StatusCode Number The HTTP status code. If the request is successful, 200 is returned. If the request fails, an error code is returned. For information about error codes, see Status codes.
Cookie String The authentication cookie that used to call API operations.
Payload JSON The error message.

The format of the returned Payload is as follows:

{
  "Code": 201,
  "Message": "sucess|reason for failure"
}

Example

$ curl -i -c token.cookie -u admin:admin1234 -k -X POST https://127.0.0.1:9999/2019-09-30/auth/cookies

HTTP/1.1 201 Created
Server: openresty/1.13.6.2
Date: Thu, 31 Oct 2019 07:51:57 GMT
Content-Type: application/json; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
Set-Cookie: token=57e22d4f9fb237fcf5c0b59abf621ddeecde1ef740a84fbeb78540******bbe4; Max-Age=3600; Path=/

{"Code":201,"Message":"success"}