login
Use the interface to log in. The cookie will carry the Session ID after logging in successfully. For example, Cookie:mwcloud-sid=xxx;mwcloud-uid=xxx.
Prototype
Protocol |
HTTP/HTTPS POST |
URL |
ip:[port]/sc_cloud/login |
Data Format |
Request: Content-Type: multipart/form-data Response: Content-Type: application/json |
Request Parameters
Parameter |
Description |
Content-Type |
Value: 'multipart/form-data;' |
Request Body
Parameter |
Description |
id |
Username |
pass |
MD5 encrypted user password |
Request Example
POST /sc_cloud/login HTTP/1.1
Content-Length: 261
Accept: application/json, text/plain, */*
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryGXBvCk8Vzymt6WUB
-----------------------------4437964479282813733506153675
Content-Disposition: form-data; name="id"
Admin
-----------------------------4437964479282813733506153675
Content-Disposition: form-data; name="pass"
e3afed0047b08059d0fada10f400c1e5
-----------------------------4437964479282813733506153675--
Response Cookies
Parameter |
Description |
mwcloud-sid |
A string value that is used to uniquely identify user logged-in. |
mwcloud-uid |
Current logged-in username. |
Response Parameters
Parameter |
Description |
Content-Type |
Value: 'application/json; charset=UTF-8' |
Response Body
Parameter |
Description |
id |
User ID. |
name |
User name. |
result |
Result code. The options are as follows:- 0: success.
- -1: password incorrect.
- -14: user does not exist.
- Other values. For details about the result codes, please refer to API Status.
|
Response Example
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Content-Length: 85
{
"id":1,
"name":"Admin",
"pass":"",
"result":0,
"sid":"OCXWUMGEYPGIAWWOETYXPNMVHDZIAZJP"
}