The data being sent with the GET is only 16 characters. My buffer is 1024 and all the headers total about 350.
Do you have a code example you can point me to? When I use POST, recv returns nothing.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I wrote a httpPlatformHandler server app using C++ and Winsock functions. When the URL is called with GET from a browser, recv returns headers. If I call the URL from a program that does a GET and includes data, I see the Content-Length header but no data. If I do a POST, recv returns nothing.
I need to know how my app can access posted data.
Another issue is that when calling from a browser, occasionally recv returns nothing or a bad gateway error.
If Winsock expert would like to look at the code, I can post that.
The data being sent with the GET is only 16 characters. My buffer is 1024 and all the headers total about 350.
Do you have a code example you can point me to? When I use POST, recv returns nothing.
recv
returns -1 and WSAGetLastError returns WSAEWOULDBLOCK which means no data is queued to be read from the socket.
The problem should be the request is read partially or hasn't been read when the execution run through while
.
For a simply solution, according to socket_dumb_http, you can check the last "\r\n\r\n"
to see whether the request is transmitted completely or not.
I have it working but the forum won't let me post any details.