用户登录系统
让用户登录系统并建立会话。
GET https://petstore3.swagger.io/api/v3/user/login
示例
- API Key
- OAuth 2.0
cURL
GET "https://petstore3.swagger.io/api/v3/user/login?username=字符串&password=字符串" \
-H "accept: application/json" \
-H "api_key: <YOUR_API_KEY>"
cURL
GET "https://petstore3.swagger.io/api/v3/user/login?username=字符串&password=字符串" \
-H "accept: application/json" \
-H "Authorization: Bearer <YOUR_OAUTH_TOKEN>"
响应
| 状态码 | 描述 |
|---|---|
| 200 | 操作成功 |
| 400 | 提供的用户名或密码无效 |
| default | 意外错误 |
响应示例
200: 操作成功
Response
{
"message": "logged in user session:abcdef12345"
}
响应标头
| 参数名 | 描述 | 类型 |
|---|---|---|
X-Rate-Limit | 用户每小时允许调用的次数。 | 整数 |
X-Expires-After | 令牌过期的 UTC 日期。 | 字符串 |
参数
查询参数
| 参数名 | 类型 | 描述 |
|---|---|---|
username | 字符串 | 用于登录的用户名。 |
password | 字符串 | 明文形式的登录密码。 |