-
Notifications
You must be signed in to change notification settings - Fork 252
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
Post not working in file_get_contents client #96
Comments
I haven't dug on the code but I think this discussion may be helpful How to post data in PHP using file_get_contents? |
If we check the code:
We'll see that Browser::post() expects string and not array. Can this be the cause of the problem? P.S. It seems that also only Curl client supports getFields() in the request object. And thus Browser::submit() will fail as well with any bundled client except Curl. |
Posting an array of data is not possible with the @kriswallsmith What about converting it when it is passed to |
Closing this since it is super old. |
I wanted to do a simple test. Send out a post to another location. It calls a file that is simply doing a print_r on $_POST.
Returns
HTTP/1.1 200 OK
Date: Sat, 29 Sep 2012 03:48:57 GMT
Server: Apache
X-Powered-By: PHP/5.3.10-1ubuntu3.2
Vary: Accept-Encoding
Content-Length: 10
Connection: close
Content-Type: text/html
Array
(
)
Returns
HTTP/1.1 200 OK
Date: Sat, 29 Sep 2012 04:07:01 GMT
Server: Apache
X-Powered-By: PHP/5.3.10-1ubuntu3.2
Vary: Accept-Encoding
Content-Length: 47
Content-Type: text/html
Array
(
[id] => 123
[name] => tester
)
The inconsistency is in the handling of the request content on post. I can see curl is handling this with a switch, but there is no equivalent on file_get_contents. Is this a limitation of file_get_contents itself I'm unaware of or simply not fully implemented?
The text was updated successfully, but these errors were encountered: