Hey guys.
I've decided to release my very barebones HTTP wrapper, in the hope that you guys might find it useful in some way.
----
SimpleWrapper
Features:
- GET and POST methods supported (no PUT)
- Cookie management
- Proxy support
- Custom user-Agent
- Gzip decompression
To do:
- Custom headers (per request?)
- Downloading files - in particular images
- Import / Export cookies, cookie lifetime management
Usage - Setup w/ proxy and custom user agent
var proxy = new WebProxy("127.0.0.1", 8888); proxy.Credentials = new NetworkCredential("foo", "bar"); var options = new WrapperOptions(proxy, "Mozilla/5.0 (Macintosh; Intel...snip"); var wrapper = new SimpleWrapper(options);
Usage - Humanised Neopets login (GET & POST)
GetString and PostString are the two methods used for GET and POST HTTP requests. Both return the HTML from the HTTP response, sans any headers.
wrapper.GetString("http://www.neopets.com"); var loginResponse = httpWrapper.PostString( "http://www.neopets.com/login.phtml", string.Format("destination=%252F&username={0}&password={1}", username, password));
Download link:
http://www.dev.lemon...mplewrapper.zip
Permalink:
http://www.dev.lemony.co/wrapper
License:
CC-BY-SA
--------------
Let me know if this helps any of you guys.