libwww-perl / libwww-perl/HTTP-Message

Batch HTTP requests

Open
#96 0 comments 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.