API DocsAPI Docs
post/api/profile/avatar/upload
post/api/profile/avatar/upload
上传用户头像
Basic Information
Request Method:
post
Request URL:
https://abit.fun/api/profile/avatar/upload
Tags:
用户资料
Description
上传用户头像图片(需要用户登录)
Header Parameters
Header Parameters Explanation
Header parameters are used to pass additional information, such as authentication credentials, content type, etc.
Parameter Name | Type | Required | Example Value | Description |
---|---|---|---|---|
Authorization | string | Required | Bearer sha_1234567890abcdef... | The authentication header is used to verify the identity of API requests, containing an access token Format: Bearer {token} |
Request Body Parameters
Request Body Parameters Explanation
Request body parameters are used to pass complex structured data, typically using the following format: application/json
Parameter Details
Parameter Name | Type | Required | Example Value | Description |
---|---|---|---|---|
avatar | string | Optional | example | 用户头像图片文件(任何格式的图片都会自动转换为JPG格式,长边最大2048像素,最大5MB) 格式: binary |
JSON Example
{
"avatar": "string"
}
Response Example
200上传成功
{
"success": true,
"message": "string"
}
400请求错误(未上传文件或文件格式不支持)
401未授权(需要登录)
500