Skip to content

Multipart stream docs #120

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 9 commits into from
Jul 19, 2016
Merged

Multipart stream docs #120

merged 9 commits into from
Jul 19, 2016

Conversation

Nyholm
Copy link
Member

@Nyholm Nyholm commented Jul 18, 2016

No description provided.

Multipart Stream Builder
========================

A multipart stream is a special kind of stream that could be used when transferring files over HTTP. There is currently no PSR-7 support for multipart streams as they are considered to be normal streams with a special content. A multipart stream HTTP request may look like this:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/that could be used when transferring files over HTTP/that is used to transfer files over HTTP/

------------------------------83ff53821b7c
Content-Disposition: form-data; name="foo"

bar
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we make this example match exactly with the example below? notably show where the text/plain content type of baz shows up?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, sounds good!

@dbu
Copy link
Contributor

dbu commented Jul 19, 2016

looks good!

reading the doc, i started to wonder why we do not have a MultipartRequestFactory instead... it would be the same, but already pack the stream into a request and add the right content type header. that would get us rid of the boundary dilemma... you could still change headers on the request you got. is there anything i might want to do with the content of a request once i have the multipart stream?

sorry to only come up with that now, only realized it when looking at the code example you provide...

@Nyholm
Copy link
Member Author

Nyholm commented Jul 19, 2016

Thank you.

sorry to only come up with that now, only realized it when looking at the code example you provide...

These are old code examples, I've showed them before. Anyhow. I do not think a MultipartRequestFactory comply with the single responsibility principle. What if you want to create a ServerRequest or a UpladedFile request with a mutlipart stream?

?PNG

???
IHDR??? ??? ?????? ???? IDATxc???51?)?:??????IEND?B`?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are the question marks intentional ? i think it was something else before. but binary data in the doc file could be a problem when other contributors edit it to update doc. so maybe thats the right thing.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The question mars are HDR��������������� �����IDATx�c���� which does not make any sense either.. I just represent binary data..

@dbu
Copy link
Contributor

dbu commented Jul 19, 2016 via email

@Nyholm Nyholm merged commit b32081d into php-http:master Jul 19, 2016
@Nyholm Nyholm deleted the multipart-stream branch July 19, 2016 12:15
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

Successfully merging this pull request may close these issues.

2 participants