Skip to main content
added 2 characters in body; edited tags
Source Link
j0k
  • 22.8k
  • 28
  • 81
  • 90

I`mI'm using the file_get_contents function to control a client, (e.g. http://ip:port/?light=onhttp://ip:port/?light=on)

When using the corresponding command in the browser it works, when i use the same url in combination with file_get_contents function it doesnt work.

When i wireshark the requests i notice that the browser is using http/1.1 and file_get_contents is using http/1.0.

I believe that the version of http is the problem why my code is not working,

How can i change this version of http in de file_get_contents function? or work around it?

I`m using the file_get_contents function to control a client, (e.g. http://ip:port/?light=on)

When using the corresponding command in the browser it works, when i use the same url in combination with file_get_contents function it doesnt work.

When i wireshark the requests i notice that the browser is using http/1.1 and file_get_contents is using http/1.0.

I believe that the version of http is the problem why my code is not working,

How can i change this version of http in de file_get_contents function? or work around it?

I'm using the file_get_contents function to control a client, (e.g. http://ip:port/?light=on)

When using the corresponding command in the browser it works, when i use the same url in combination with file_get_contents function it doesnt work.

When i wireshark the requests i notice that the browser is using http/1.1 and file_get_contents is using http/1.0.

I believe that the version of http is the problem why my code is not working,

How can i change this version of http in de file_get_contents function? or work around it?

Source Link
Tobrun
  • 18.4k
  • 10
  • 68
  • 82

PHP file get contents, http version

I`m using the file_get_contents function to control a client, (e.g. http://ip:port/?light=on)

When using the corresponding command in the browser it works, when i use the same url in combination with file_get_contents function it doesnt work.

When i wireshark the requests i notice that the browser is using http/1.1 and file_get_contents is using http/1.0.

I believe that the version of http is the problem why my code is not working,

How can i change this version of http in de file_get_contents function? or work around it?