Api接口调用百度千帆大模型提示`unsupported content type`错误。
Api接口调用百度千帆大模型提示unsupported content type
错误。
5 回复
确保请求头中Content-Type设置正确,如application/json。
检查请求头中的Content-Type
,确保设置为application/json
。
unsupported content type
错误通常是由于请求头中的Content-Type
设置不正确导致的。请确保在调用百度千帆大模型的API时,将Content-Type
设置为application/json
,并且请求体是合法的JSON格式。例如:
POST /your-endpoint HTTP/1.1
Host: api.example.com
Content-Type: application/json
Authorization: Bearer your-access-token
{
"prompt": "你的输入内容"
}
如果问题仍然存在,请检查API文档,确认是否有其他特定的请求头或格式要求。
确保请求头中Content-Type设置正确,如application/json。