Curl 400向POST请求添加utf-8字符集时请求错误

Curl 400向POST请求添加utf-8字符集时请求错误,curl,asana,Curl,Asana,我已经基于Guzzle构建了一个API客户端,自3.4.2版以来,它在内容类型头中添加了utf-8字符集。有了这个头,AsanaAPI返回一个400错误请求错误,而没有字符集,一切正常 这不适用于POST和PUT请求: 内容类型:application/x-www-form-urlencoded;字符集=utf-8 这项工作: 内容类型:application/x-www-form-urlencoded 使用curl作为最简单的示例: 这个失败了: curl -u {apikey}: https

我已经基于Guzzle构建了一个API客户端,自3.4.2版以来,它在内容类型头中添加了utf-8字符集。有了这个头,AsanaAPI返回一个400错误请求错误,而没有字符集,一切正常

这不适用于POST和PUT请求:

内容类型:application/x-www-form-urlencoded;字符集=utf-8

这项工作:

内容类型:application/x-www-form-urlencoded

使用curl作为最简单的示例:

这个失败了:

curl -u {apikey}: https://app.asana.com/api/1.0/projects -d "name=Test" -d "notes=Test." -d "workspace={workspace-id}" --header "Content-Type: application/x-www-form-urlencoded; charset=utf-8"
使用此输出返回400错误请求:

{“errors”:[{“message”:“请求数据必须是JSON对象,而不是null”}]}

这一次成功了:

curl -u {apikey}: https://app.asana.com/api/1.0/projects -d "name=Test" -d "notes=Test." -d "workspace={workspace-id}" --header "Content-Type: application/x-www-form-urlencoded;"
这将返回使用发送的数据创建的201

其他POST和PUT请求也会发生这种情况。 这是Asana API中的错误还是预期行为?

(我在Asana工作。)我们已验证这是错误。修复应该在第二天左右开始。谢谢你的报道

(我在Asana工作。)这可能是我们系统中的一个缺陷。我们会调查并报告的。