curl - 400 Bad Request when adding utf-8 charset to POST request -


i've build api client based on guzzle since version 3.4.2 adds utf-8 charset content-type header. header asana api returns 400 bad request error, while without charset things work fine.

this doesn't work on post , put requests:

content-type: application/x-www-form-urlencoded; charset=utf-8

this works:

content-type: application/x-www-form-urlencoded;

using curl simplest example :

this 1 fails:

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" 

returns 400 bad request output :

{"errors":[{"message":"request data must json object, not null"}]}

this 1 succeeds:

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;" 

this returns 201 created data send.

this happens other post , put requests well. bug in asana api or expected behaviour?

(i work @ asana.) we've verified bug. fix should live in next day or so. reporting!


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -