-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[HTTPFoundation] PUT Request Data #793
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
Conversation
This is already supported. Look at Request::getContent(). |
That's not the same thing. You can't bind a form to a request submitted via PUT unless the PUT request values are actually part of the Request::request ParameterBag. |
This cannot be applied since php://input can only be read once. People would have no way to access the PUT data anymore. Besides the put data might not be a url-encoded list of key/value pairs. If you need this then it's better if you do that in a Request listener. |
OK, the read-once thing is certainly a deal breaker. But there must be a way to implement this in the Request class as standard. Symfony 1 supported PUT requests without a problem. |
I flattened the two commits. The pull no longer causes the Request have no value for getContent(). |
You probably also want to check if the content type is 'application/x-www-form-urlencoded' (or null?). As Johannes suggested, this should probably go in a RequestListener. Kind of like is done in the RestBundle: https://github.com/FriendsOfSymfony/RestBundle/blob/master/Request/RequestListener.php except it will be in the FrameworkBundle. |
I wasn't aware of the existence of RestBundle. I'm going to investigate that before pursuing this further. Thanks for the pointer. |
@Chekote: is there anything missing in RestBundle for your use case? |
Not sure yet. I'm going to be trying it out today (or Tomorrow, Monday's are On Mon, May 9, 2011 at 7:38 AM, lsmith77 <
|
I've just create a patch in the Form component here #849 |
Modified Request to handle data submitted via PUT.
I wanted to update the tests for this, but I don't know if it's possible, given that you cant modify the value of the php://input stream.