libwww-perl / libwww-perl/HTTP-Message
Batch HTTP requests
Nobody has claimed this yet.
- Dominant language
- Perl
- Stars
- 32
- Forks
- 63
- Avg merge
- 5h 14m
- Merged PRs (30d)
- 1
Description
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/
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the $r->add_part() function and inspect how it formats each multipart batch section. Compare its output with the OData batch-processing specification and the example in this issue; done means each part includes the required application/http and binary transfer-encoding headers without breaking existing behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- perl
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 50/100