I'm trying to get my embedded board to POST a file using HTTP to an Apache server running on my desktop.
I send this in the HTTP header:
Code:
strcpy(pcBufferToTransmit,"POST /incoming/records.txt http/1.1\r\n");
strcat(pcBufferToTransmit,"Host: 192.168.0.106\r\n");
strcat(pcBufferToTransmit,"Connection: close\r\n");
strcat(pcBufferToTransmit,"Content-Type: application/octet-stream\r\n");
strcat(pcBufferToTransmit,"Content-Length: 20\r\n\r\n");
FreeRTOS_send(xHTTPSocket,pcBufferToTransmit,MessageLength , 0 );
This is C code on theembedded server which concatenates those strings into one header string.
I then send a packet of twenty bytes, just 0-20. to send a dummy file.
The attached image shows how it comes out in Wireshark. It all gets bumdled up in to a single TCP packet and sent out. However, I get back an error 404, again, shown in a Wireshark JPEG attached.
I have given the incoming directory full permissions to be written to and. This "incoming" directory is in the same directory as index.html which I can get from the server with a GET command.
Is there anything anyone can think of that I am doing wrong? I don't really know anything about Apache setup and I am learning about using TCP/IP on embedded systems - so there are a lot of unknowns for me here.
I would stress that a GET cvommand pulls off index.html and sends it to me embedded board just fine, so the Apache server is working. At least in one direction.
If there is any other information that would help track this down, just ask!
Many thanks!