Re: RFC: Server-Side Request and Response Objects (v2)
| From: | Ruud Boon | Date: | Thu, 13 Feb 2020 06:45:06 +0000 |
| Subject: | Re: RFC: Server-Side Request and Response Objects (v2) | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-108529@lists.php.net to get a copy of this message | ||
Hi!
I really like this RFC.
> On 12 Feb 2020, at 23:46, Paul M. Jones <pmjones@pmjones.io> wrote:
>
> Hi Allen & Robin,
>
> Allen, you asked:
>
>> On Feb 12, 2020, at 15:27, AllenJB <php.lists@allenjb.me.uk> wrote:
>>
>> This might be more a "future scope" thing, but I would like to see a way to
>> access the raw request body as part of this. Currently (as far as I know) the only way is to
>> open/read php://input, which isn't particularly intuitive in my opinion.
>
>
> Robin asked the same thing earlier:
>
>> On Feb 11, 2020, at 08:24, Kingsquare.nl - Robin Speekenbrink <robin@kingsquare.nl>
>> wrote:
>>
>> What i haven't clearly seen in the RFC nor the interfaces of the proposed objects: how
>> will this handle PUT / php:://input / raw posted data? Or am i missing something?
>
> Answer: the php://input stream is accessible via the ServerRequest $content property; see
> <https://github.com/pmjones/ext-request#content-related>.
In the the RFC I see that $content will return php://input <php://input> using
file_get_contents on the fly. Can we add the possibility to get a reference to the stream as well?
This allows the use of stream_copy_to_stream, mime_content_type etc without reading the fill input
to memory.
>
>
> --
> Paul M. Jones
> pmjones@pmjones.io
> http://paul-m-jones.com
>
> Modernizing Legacy Applications in PHP
> https://leanpub.com/mlaphp
>
> Solving the N+1 Problem in PHP
> https://leanpub.com/sn1php
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
Cheers,
Ruud
Attachment: [application/pgp-signature] Message signed with OpenPGP signature.asc
Attachment: [application/pgp-signature] Message signed with OpenPGP signature.asc