-
-
Notifications
You must be signed in to change notification settings - Fork 65
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
Set protocol version on request creation #49
Conversation
Thanks @WyriHaximus - this works for my purposes. |
Set protocol version on request creation
Please tell me where I am wrong, `cause it does not work for me - I can not get response body with HTTP 1.1: $request = $client->request('GET', 'http://facebook.com', [], '1.1');
$request->on('response', function ($res) {
$res->on('data', function ($data, $res) {
var_dump($data);
});
}); it does not work for http://vk.com, http://facebook.com |
@deathmood It doesn't work that way for a) the HTTP version comes back with the response headers, not with the body and b) there is no guarantee that the server will response with a HTTP/1.1 response |
@WyriHaximus actually it does response with HTTP/1.1: $req = $client->request('GET', 'https://vk.com');
$req->on('response', function ($res) {
$res->on('data', function ($data, $r) {
var_dump($r);
var_dump($data);
});
});
$req->end(); var_dump($r) var_dump($data) both on http://vk.com and http://facebook.com. But I can not get P.S. it works normally (at least I can get all |
Follow up for #43 and fixes #47. This way a user can present it self as a HTTP1.1 client.