Home All Groups Group Topic Archive Search About

Alternative to HttpWebRequest for posting

Author
31 Mar 2006 8:23 AM
Bais
Are there any alternatives to HttpWebRequest for posting?
I think using the HttpWebRequest for the "multipart/form" will require quite
an amount of code.

I would rather like something similar to:
HttpWebPost post = new HttpWebPost("http://somehere.over.the/rainbow");
post.setEncodingType(EncodingTypes.multipart);
post.addParameter("username", "Mr Test");
post.addParameter("password", "secret");
HttpWebResponse response = post.GetResponse();

The HttpClient java library is an excellent java-version of a this kind of
library.

Author
31 Mar 2006 6:24 PM
Joerg Jooss
Thus wrote Bais,

> Are there any alternatives to HttpWebRequest for posting?
> I think using the HttpWebRequest for the "multipart/form" will require
> quite
> an amount of code.
> I would rather like something similar to:
> HttpWebPost post = new
> HttpWebPost("http://somehere.over.the/rainbow");
> post.setEncodingType(EncodingTypes.multipart);
> post.addParameter("username", "Mr Test");
> post.addParameter("password", "secret");
> HttpWebResponse response = post.GetResponse();
> The HttpClient java library is an excellent java-version of a this
> kind of library.

WebClient has the UploadFile() method, which implements multipart/form-data,
though it's not as powerful as a full HttpClient port would be.

Cheers,
--
Joerg Jooss
news-re***@joergjooss.de

AddThis Social Bookmark Button