Skip to content

Show how to properly quote the boundery #175

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

Merged
merged 2 commits into from
Feb 16, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions components/multipart-stream-builder.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ A multipart stream is a special kind of stream that is used to transfer files ov

POST / HTTP/1.1
Host: example.com
Content-Type: multipart/form-data; boundary=578de3b0e3c46
Content-Type: multipart/form-data; boundary="578de3b0e3c46.2334ba3"

--578de3b0e3c46
--578de3b0e3c46.2334ba3
Content-Disposition: form-data; name="foo"
Content-Length: 15

Expand All @@ -23,13 +23,13 @@ A multipart stream is a special kind of stream that is used to transfer files ov

???
IHDR??? ??? ?????? ???? IDATxc???51?)?:??????IEND?B`?
--578de3b0e3c46
--578de3b0e3c46.2334ba3
Content-Type: text/plain
Content-Disposition: form-data; name="baz"
Content-Length: 6

string
--578de3b0e3c46--
--578de3b0e3c46.2334ba3--


In the request above you see a set of HTTP headers and a body with two streams. The body starts and ends with a "boundary" and it is also this boundary that separates the streams. That boundary also needs to be specified in the ``Content-Type`` header.
Expand All @@ -54,7 +54,7 @@ To build a multipart stream you may use the ``MultipartStreamBuilder``. It is no
$request = MessageFactoryDiscovery::find()->createRequest(
'POST',
'http://example.com',
['Content-Type' => 'multipart/form-data; boundary='.$boundary],
['Content-Type' => 'multipart/form-data; boundary="'.$boundary.'"'],
$multipartStream
);

Expand Down