First off, I know the square root of sod all about curl and I'm not trying to learn it. I'm told it might help me out tracking down a problem in some C code where I am trying to write data to an Apache server. I may be barking up completely the wrong tree here.
What I want to do is to do an HTTP POST from my laptop to my desktop which is running the HTTP server, so hopefully see exactly what the raw HTTP would look like using Wireshark. Then I can go back to the C code on my embedded board with a better idea of how to get that working.
I have tried the following command:
curl -X POST -d @test.txt 192.168.0.106/incoming
Where text.txt just contains "Hello World" in plain text (created with vim). .106 is the Apache server...which serves files nicely with a GET command.
But that gives:
Warning: Couldn't read data from file "test.txt", this makes an empty POST.
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>301 Moved Permanently</title>
</head><body>
<h1>Moved Permanently</h1>
<p>The document has moved <a href="http://192.168.0.106/incoming/">here</a>.</p>
</body></html>
Many thanks!