Accessing edit page through webrequest

May 1, 2007 at 10:02 PM
I'm trying to get the HTML content of the edit page through a webrequest (to extract the wiki content back) but I cannot seem to get the WebRequest credentials right. Has anybody tried this previously?
May 2, 2007 at 6:15 AM
You would need to post your credentials to the login.aspx (via HTTPS of course!) and save the returned auth cookie in a cookie container. Set that same cookie container on your WebRequest when calling the wiki edit page.
May 2, 2007 at 7:22 AM
Could you elaborate a little bit more about the details to do this? Or altenatively, point me to a web service that can access the wiki content. :)
May 2, 2007 at 4:22 PM
There should be plenty of articles online on how to fake forms authentication.

Of course this isn't supported on most sites (including CodePlex). The structure of a given page may change at any time, so do this at your own risk.
May 2, 2007 at 10:22 PM
Unfortunately, there is no service to access the wiki so what else can I do?

>> Of course this isn't supported on most sites (including CodePlex).
Does this mean what you suggested will not work?
May 3, 2007 at 5:43 AM
Sorry, what I meant to say was: it is possible to get the source of a wiki page using the WebRequest class, it just may not work indefinitely. The problem is that a method that is dependent on something volatile (like HTML content) is fragile. If the structure of the Wiki/Edit.aspx page changes it's possible that your code to extract the wiki content won't work anymore. Anyone who relies on the structure of a page does so at their own risk.

We recently released a WebService API to create releases on the site. If you would like to see an API for managing wiki content (which I think is a good idea), then please file a feature request in our issue tracker.
May 3, 2007 at 7:24 AM
I want services for everything, it's that simple. i'll file some feature request. Thanks for the tip.