Subject: [boost] ASIO
From: Mohammed Rasmy (mohammed_rasmy_at_[hidden])
Date: 2009-11-04 20:57:47
I am trying to do a POST request using Boost::Asio, of a variable x
that holds an email address, and a variable y that holds the contents
of a zip file.
I couldn't find samples floating around and I'm unsure of how to
proceed. I've come up with the following code:
wxString buffer = wxT("POST ");
buffer += wxT("http://serveraddress.com");
buffer += wxT(" HTTP/1.1\r\n");
buffer += wxT("Host: serveraddress.com\r\n");
buffer += wxT("Accept: */*\r\n");
buffer += wxT("Connection: close\r\n\r\n");
buffer += wxT("email_address=test_at_[hidden]");
buffer += wxT("zip_file=")/*actual zip file data here?*/;
request_stream << buffer.mb_str();
Note that I am using wxWidgets, wxT is nothing more than a way of
defining strings there, and wxString is, well, a string. The above code
compiles fine, but I am not sure how to add the zip file? Also would
the above code work? I know it is working for a GET request but that's
it. Please advise.
Thanks for your time,
Keep your friends updatedeven when youre not signed in.