Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Batch HTTP requests #96

Open
robhammond opened this issue Feb 6, 2018 · 0 comments
Open

Batch HTTP requests #96

robhammond opened this issue Feb 6, 2018 · 0 comments

Comments

@robhammond
Copy link

I had trouble getting the multipart/mixed batch requests working with Google's APIs (a bunch of 400 bad request errors).

Figured out that the $r->add_part() function needs to add the following headers after the --batch_number block:

Content-Type: application/http
Content-Transfer-Encoding:binary

ie:

--batch_YUS7l5AzBL0sRpe
Content-Type: application/http
Content-Transfer-Encoding:binary

POST /analytics/v3/management/accounts/XXXXX/webproperties/UA-XXXXXX-X/profiles/XXXXXXXX/entityUserLinks
Content-Type: application/json

{"permissions":{"local":["READ_AND_ANALYZE"]},"userRef":{"email":"abc@example.com"}}

As per the spec here:
http://www.odata.org/documentation/odata-version-3-0/batch-processing/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant