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