how to HTTP post a files and key-value pairs?
-
Hi! I am a bit lost. I want to upload a files and key-value pairs via HTTP post. A single file and a single collection of key-value pairs is easy. You just have to use the System.Net.WebClient class and its UploadFile, UploadValues method. Can anyone explain to me how to post both files and values with one request? I would very much appreciate any hint! with Regards Amjath
-
Hi! I am a bit lost. I want to upload a files and key-value pairs via HTTP post. A single file and a single collection of key-value pairs is easy. You just have to use the System.Net.WebClient class and its UploadFile, UploadValues method. Can anyone explain to me how to post both files and values with one request? I would very much appreciate any hint! with Regards Amjath
Well, I guess it depends on what the server is expecting. Is it expecting files and name value pairs in a single request? Another way of posting data to the web is to use the HttpWebRequest Class. This has a property which I think is called 'verb' which you want to set to POST. You can then send as much data as you like using this. It's stream based. Is that the sort of thing you're after?
Regards, Rob Philpott.