Picgo+github上传图片报错
查看picgo.log日志文件
[PicGo ERROR] {
"method": "PUT",
"url": "https://api.github.com/repos/#######",
"statusCode": 422,
"message": "Request failed with status code 422",
"stack": {},
"response": {
"status": 422,
"statusCode": 422,
"body": {
"message": "Invalid request.\n\n\"sha\" wasn't supplied.",
"documentation_url": "https://docs.github.com/rest/reference/repos#create-or-update-file-contents"
}
}
}
状态码 422 Unprocessable Entity
请求格式正确,但是由于含有语义错误,无法响应。
422 则表现为请求格式错误,但出现了 语义 错误,以至于服务端无法响应。可以理解为服务端能理解请求资源类型 content-type,否则应该返回 415(Unsupported Media Type),也能理解请求实体内容,否则应该返回 400(Bad Request)。
图床设置错误
解决方法:
自定义域名设置为:https://cdn.jsdelivr.net/gh/用户名/仓库名