From: Raindog <ra...@ma...> - 2010-12-03 20:14:07
|
On 12/2/2010 7:24 PM, Dean Michael Berris wrote: > On Fri, Dec 3, 2010 at 11:04 AM, Raindog<ra...@ma...> wrote: > > "Dean Michael Berris"<mik...@gm...> wrote: > >> > >>Actually this isn't an HTTP POST, but rather an HTTP GET request with > >>the query parameter supplied. This would work for what you intend to > >>do: > >> > >> http::client client; > >> http::client::request > >>request("http://www.mysite.com/site.cgi?foo=bar&baz=quid"); > >> http::client::response response = client.get(request); > >> > >>HTH > >> > > > > I realize now that after your response that I need also to send a file, I am trying essentially to fill out a web form w/ a file upload element, along with some options, hence why I thought it was a POST. I apologize for not being clear > > > > Re-arranging your response for posterity. ;) > > So even in that situation, instead of using 'client.get' you can use > 'client.post', and then put the file contents as part of the request. > This isn't easily supported at the moment because the client requires > that the contents be in a string. If your file is large (multiple > megabytes) it is an issue and I'm going to address that limitation in > the coming 0.9 release. > > Let me know if you need any more information regarding how to make the > file contents part of the POST request. > > That would be great if you could. I'm not familiar with HTTP hence why I wanted to use your library =). I know that I need a content length and some field designating the encoding used, but I don't know how I would separate the query string parameters from the actual file being uploaded. Thanks! |