Tim Jameson Posted May 16, 2017 Report Share Posted May 16, 2017 OK, I am stuck, and to be honest I have no idea why I am stuck. All I want to do is request a web page from a web server. Specifically, I have created a PHP page that will return the string "OK" when called. I am using this page for the PLC to report that it has an error. Inside the PHP, I will use the parameters to identify the PLC and the error. This should be easy, Right? I have configured my port and my TCP/IP configuration to socket 3, port 504. I issue a TCP/IP connect to the server (IP is correct, port is 80), and it appears to connect. I then issue a TCP/IP Send to send the GET /url/r/nHost: <hostname>/r/n/r/n/r/n. And that is where I am stuck. It does not appear that the message is sent to the sever. In fact, my web server never "sees" the request. Does anyone have any idea how to issue a url request to a web server? I do not even care about what I get back, I just want to call the page. Any help is greatly welcome. Thank you in advance. Tim J. Quote Link to comment Share on other sites More sharing options...
Tim Jameson Posted May 16, 2017 Author Report Share Posted May 16, 2017 OK, I found the solution. You must use TCP_RAW Send and your message must be in a format like: GET http://localhost:2006/1.aspx HTTP/1.1\r\n" + "Host: localhost:2006\r\n" + "Connection: keep-alive\r\n" + "User-Agent: Mozilla/5.0\r\n" + "\r\n"; I did not use the User-Agent stuff, but I still included an empty line. Once I did this, my web server started reporting the GET request. 1 Quote Link to comment Share on other sites More sharing options...
MVP 2022 Joe Tauser Posted May 16, 2017 MVP 2022 Report Share Posted May 16, 2017 Thank you for the contribution! Joe T. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.