webrequest

Issue regarding accessing URLs with escaped characters in C#

I have an issue with URLs being transformed automatically as they are being processed. Uri myUri = new Uri(this.url); HttpWebRequest request = (HttpWebRequest)WebRequest.Create(myUri); request.ProtocolVersion = HttpVersion.Version10; request.Method = "GET"; HttpWebResponse response = (HttpWebResponse)request.GetResp...

WebBrowser and Cookies c#

I have a Cookie Container i'm using on lets say Form1 from a webRequest, after its a successful login with the request it stores the cookie in the cookie container.. How can i assign that cookie to a webBrowser control on Form2 so that it doesnt ask for a login again? Thanks! ...

XMLDocument, problem reading Node...

Hello, I am doing the following: System.Net.WebRequest myRequest = System.Net.WebRequest.Create("http://www.atlantawithkid.com/feed/"); System.Net.WebResponse myResponse = myRequest.GetResponse(); System.IO.Stream rssStream = myResponse.GetResponseStream(); System.Xml.XmlDocument rssDoc = new System.Xml.XmlDocument(); rssDoc.Load(...

HttpWebRequest in .NET - Logging into a webpage

Hi - Simple question ahead! STATUS: I've come this far I've implemented a solution where I get a cookie with a session, but it still doesn't work. In the sniffer tool, I can see the difference between my application and when using the real website as this: REAL: ASPSESSIONIDSCRAASDB=EFFBFPEAKOBJGLAPNABPLLCB; passes=15; ChatCannel=1 ...

WebRequest doesn't make cached items available in the same process

We're seeing a strange behavior where things that get cached (in the IE/wininet cache) as a result of using the WebRequest API are not available from the cache until a new process is created. Consider the following code: using System; using System.IO; using System.Net; using System.Net.Cache; using System.Threading; namespace HttpCach...

WebRequest to POST data but what about hidden fields?

Hi, I need to essentially POST some hidden fields to a page, which i need to load in the browser window. This is for the SagePay forms integration as per page 6: http://www.docstoc.com/docs/10745827/Sage-Pay-Form-Protocol-and-Integration-Guidelines I am already using WebRequest to create the POST but how do I send the 4 hidden fields t...

C# WebRequest POST returns Html page - how to display it in browser

Hi, I'm working with the SagePay payment gateway. On a checkout button click I'm using the method below to postData (contains the transaction data) to SagePay who then return the result in the form of a html page. public string SendRequest(string url, string postData) { var uri = new Uri(url); var request = WebRequest.Create(ur...

Pause Download & Resume (Merge The Existing File)

I'm making a downloader using C#, i want to add a feature of Pause & Resume download, i googled & implemented the suggestions but it didn't work for me meaning it started the download from the correct position but its not merging the existing file correctly, i tested it by downloading a video file but after pausing the download & startin...

System.Net.WebRequest - TCP Connection Resuse/Cache ??

This issue has me stumped. It's happened three times in the last 12 months on our production server and causes major issues when it does. Any help would be appreciated. We have a .NET Windows Service that sends HTTP requests to a third-party server. "Something" happens and the next 2-3 requests fail with server error 503, subsequent req...

TcpClient sometimes needs to wait a few hundred milliseconds to be able to send

Hello everybody. I've got quite a weird problem. I'm writing a wrapper for TcpClient to send and receive HTTP requests. The main reason I don't use the built-in WebRequest is because I need a support for SOCKS proxies, and WebRequest does not support it. Anyway, in one of my tests(That use no proxy, just ordinary TcpClient), I've got a...

Cannot send a content-body with this verb-type.

Hello, I just got this exception (ProtocolViolationException) in my .NET 2.0 app (running on windows mobile 6 standard emulator). What confuses me is that as far as i know, I have not added any content body, unless I've inadvertently done it somehow. My code is below (very simple). Is there anything else i need to do to convince .NET...

WebRequest.BeingGetResponse and IAsyncResult.AsyncWaitHandle not working

WebRequest.BeginGetResponse returns IAsyncResult, which has a member AsyncWaitHandle. Initially, I thought that I could just wait on that in the initiating code. But it turns out that the event is signaled as soon as the request is made and before and not after EndGetResponse is called. This seems unintuitive for me but whatever. So, ...

vb.NET WebRequest to read aspx page to string, access denied?

I'm trying to make an executable in VS2008 that will read a webpage source code using a vb.NET function into a string variable. The problem is that the page is not *.html but rather *.aspx. I need a way to execute the aspx and get the displayed html into a string. The page I want to read is any page of this type: http://www.realtor.ca/...