gmail api - Batch request - 400 bad request response -


i'm sending following batch request getting threads:

post /batch http/1.1 host: www.googleapis.com accept-encoding: gzip user-agent: magin (gzip) accept-language: en;q=1, fr;q=0.9, de;q=0.8, zh-hans;q=0.7, zh-hant;q=0.6, ja;q=0.5 content-type: multipart/mixed; type="application/http"; boundary="737d0154-1999-455c-9886-65d7121a1382"  access_token=acctoken&quotauser=user  --737d0154-1999-455c-9886-65d7121a1382 content-type: application/http content-id: <0x8d93fa0>  /gmail/v1/users/me/threads/146df2dd11472f07 http/1.1 host: googleapis.com accept-encoding: gzip user-agent: magin (gzip) accept-language: en;q=1, fr;q=0.9, de;q=0.8, zh-hans;q=0.7, zh-hant;q=0.6, ja;q=0.5   --737d0154-1999-455c-9886-65d7121a1382 content-type: application/http content-id: <0x8d93190>  /gmail/v1/users/me/threads/146df14c9a13b5d9 http/1.1 host: googleapis.com accept-encoding: gzip user-agent: magin (gzip) accept-language: en;q=1, fr;q=0.9, de;q=0.8, zh-hans;q=0.7, zh-hant;q=0.6, ja;q=0.5   --737d0154-1999-455c-9886-65d7121a1382 content-type: application/http content-id: <0x8d93190>  /gmail/v1/users/me/threads/146def434891a5b0 http/1.1 host: googleapis.com accept-encoding: gzip user-agent: magin (gzip) accept-language: en;q=1, fr;q=0.9, de;q=0.8, zh-hans;q=0.7, zh-hant;q=0.6, ja;q=0.5   --737d0154-1999-455c-9886-65d7121a1382 content-type: application/http content-id: <0x8d93190>  /gmail/v1/users/me/threads/146def1dbfe6579c http/1.1 host: googleapis.com accept-encoding: gzip user-agent: magin (gzip) accept-language: en;q=1, fr;q=0.9, de;q=0.8, zh-hans;q=0.7, zh-hant;q=0.6, ja;q=0.5   --737d0154-1999-455c-9886-65d7121a1382 content-type: application/http content-id: <0x8d93190>  /gmail/v1/users/me/threads/146def155ca0ab2b http/1.1 host: googleapis.com accept-encoding: gzip user-agent: magin (gzip) accept-language: en;q=1, fr;q=0.9, de;q=0.8, zh-hans;q=0.7, zh-hant;q=0.6, ja;q=0.5 --737d0154-1999-455c-9886-65d7121a1382-- 

however 400 bad request response google servers: request failed: bad request (400)

any ideas why happening , how can fix it?

edit: interesting behavior: works if there <= 3 batched requests if there more doesn't.

two things notice:

(1) space before content-type on first part

(2) missing final "--737d0154-1999-455c-9886-65d7121a1382--" @ end of post (on it's own line, etc), note trailing "--" after boundary well...


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

jsf - How to ajax update an item in the footer of a PrimeFaces dataTable? -

django - CSRF verification failed. Request aborted. CSRF cookie not set -