httpwebrequest

How to handle ASP.NET Authentication

Hi, I have the following problem: I want to protect the access to some files hosted under IIS using an asp.net page. The page will be called from another application using: var request = WebRequest.Create("www.smth.com/protectData.aspx") as HttpWebRequest; request.Credentials = new NetworkCredentials("john doe", "john");...

500 Internal Server Error when using HttpWebRequest, how can I get to the real error?

I'm trying to improve the information provided in response to an error handled within an app. This is the code: Try httpRequestObj = HttpWebRequest.Create(strRequest) httpRequestObj.Method = "GET" httpRequestObj.UseDefaultCredentials = True * httpResponse = httpRequestObj.GetResponse Using reader A...

is there a popular C# library for working HTTP? Eg simplifing working with httpwebrequest etc

Hi is there a popular C# library for working HTTP? Eg simplifing working with httpwebrequest etc For example doing http file upload with some parameters requires many lines and knowledge of Http protocol content format etc. WebClient itself do not do it. So being new, is there a well know library that c# developers use here? Thank...

Silverlight streaming upload

I have a Silverlight application that needs to upload large files to the server. I've looked at uploading using both WebClient as well a HttpWebRequest, however I don't see an obvious way stream the upload with either option. Do to the size of the files, loading the entire contents into memory before uplaoding is not reasonable. Is this ...

How do I get a responseLength for a HttpWebRequest upload from another webfile I want to stream into the upload when the source webserver doesn't implement ContentLength???

Hi, Background - I'm trying to stream an existing webpage to a separate web application, using HttpWebRequest/HttpWebResponse in C#. One issue I'm striking is that I'm trying to set the file upload request content-length using the file download's content-length, HOWEVER the issue seems to be when the source webpage is on a webserver fo...

Anyone have sample code for doing a "chunked" HTTP streaming download of one web directly to a upload to a separate web server???

Hi, Background - I'm trying to stream an existing webpage to a separate web application, using HttpWebRequest/HttpWebResponse in C#. One issue I'm striking is that I'm trying to set the file upload request content-length using the file download's content-length, HOWEVER the issue seems to be when the source webpage is on a webserver for...

Efficent way of retrieveing HttpWebResponse and putting it in XDocument

There is a local service from which I need to consume a generated XML Document Stream. Though the end point is not a REST service per se. I wanted to be sure the method I've outlined below is the most efficient way of getting the response returned into an XDocument. Uri requestUri = null; Uri.TryCreate(String.Format(SearchAddress, filte...

WebRequest POST with both file and parameters

Hi guys, I'm trying to upload a file and a send along a few parameters to my site using .NET / C#. Having read a few tutorials that do either a few parameters or a file, I've tried, unsuccessfully, to combine them. Here is how I try doing it: WebRequest req = WebRequest.Create(baseURL + "upload"); req.Credentials = new NetworkCredentia...

HTTP request using threading from iphone

Can anyone point out a turorial which explains threading?? In my application, i'm uploading some data (even large sized images) to the servelet. The uploading process may take quite a large time depending on the bandwidth, as usual. So i need to implement threading in it so that the uploading process takes place in the background. Any ex...

Keeping session alive C#

I'm using HttpWebRequest to log on to a website and get the session cookie. My application scrapes certain pages, and eventually becomes idle, resulting in the session dying. What would be a good way to prevent this and -just being curious- how do web browsers do it? ...

IOException when making HttpWebRequest to local ASHX file

Greetings, all. Here is my situation. I am attempting to make an HttpWebRequest to a local handler file and I keep getting the following exception: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. Now, I'm using a local handler file because I am writing some integration...

C++ interface version of HttpWebRequest and HttpWebResponse.

Hi All, We are wondering how to use HttpWebRequest and HttpWebResponse .net framework Class in ATL c++ project is their any interface exposed for webrequest class in C++, currently we cannot have a c# project so we are looking for alternative interface. Any help will be greatly appreciated. Ramanand. ...

Calling Abort on a HttpWebRequest asynchronous POST

Wondering... I have a test whereby calling abort on a HttpWebRequest asynchronous GET requests seems to make the request abort and return the relevant status code. However for POST requests, calling Abort does not have the same effect. It appears to continue processing the request regardless. Is this by design or am I doing something wro...

HttpWebRequest issue.

I am having a slight issue with the HttpWebRequest protocol, and I am wondering whether I should try a different approach or perhaps I am doing something wrong. The issue I am having is this. I have a client/server which sends a HttpWebRequest to a server. The server receives this response, then runs a small utility which generates a fi...

Way of checking IsPostBack or IsCallBack from within a VB.NET class

I need to be able to tell from within a VB.NET class (not a user control) whether or not the current request is a PostBack and/or CallBack (AJAX). In the past I've been able to get information about the request, response, session, etc through HttpContext.Current but I haven't been able to find the Page object in HttpContext.Current. Is...

Easier way to download a string with cookies?

Is there an easier way to write this? I know if i didnt need cookies i could have done var sz = new WebClient().DownloadString(url); But i need cookies bc of login data so i am stuck with this instead. Is there a way to make it short like the line above? request = (HttpWebRequest)HttpWebRequest.Create(url); request.C...

twitter streaming api - set filter in http post request (apache httpcomponents)

Hi, I'm trying out the twitter streaming api. I could succesfully filter tweets by using curl, as stated here: curl -d @tracking http://stream.twitter.com/1/statuses/filter.json -u <user>:<pass> where tracking is a plain file with the content: track=Berlin Now I tried to do the same thing in JavaSE, using Apache's HTTPComponents: ...

Asynchronous HttpWebRequests and a null HttpContext.Current.Response/Request object.

I have a web application the relies heavily on web services. Everything with the services is done asynchronously and with AddOnPreRequestHandlerExecuteAsync. Anyhow, most of my calls work just fine, but some are returning from their asynchronous service calls to find a null HttpContext.Current.Response/Request object in the endprerequest...

rss feed service request parameter charset

First of all, I'd consider myself a very beginner in services development so pardon my ignorance here... I've created the rss syndication feed service (rest) in wcf and have problems with the request parameter values character. I need to pass the name as the parameter which contains the characters from the ISO 8859-2..... the request loo...

Load Data by HTTPService from Url into Flex text area as a string

Hi all I want to use an HTTPService to load some data (number of columns and number of rows) which change randomly by a certain frequency I get the string like freq#ncols#nrows#value. How can i display for example: 1000#21#13#2391 that means: in 21 col, 13 row i have the value of 2391 which changes every 1 second. Thanks ...