httpwebrequest

httpwebrequest Cookiecontainer

Hello, How do I handle cookies with paths other than "/". An HttpWebRequest object returns these headers: HTTP/1.1 302 Moved Temporarily Transfer-Encoding: chunked Date: Wed, 10 Jun 2009 13:22:53 GMT Content-Type: text/html; charset=UTF-8 Expires: Wed, 10 Jun 2009 13:22:53 GMT Cache-Control: no-cache, must-revalidate, max-age=0 Server...

Using the VS Web Test Classes outside Visual Studio

I use HttpWebRequests pretty extensively - I've found that the Visual Studio Web Test classes (i.e. WebTestRequest and WebTestResponse etc) offer a lot of really nice methods that i'd love to start using. But I can't seem to find a way to use these classes outside of the Visual Studio's testing framework. Has anyone done this? ...

Basic HTTP Authentication on iPhone

Hello, I'm trying to get a small twitter client running and I ran into a problem when testing API calls that require authentication. My password has special characters in it, so when I try to use the following code it doesn't work. NSString *post = [NSString stringWithFormat:@"status=%@", [status stringByAddingPercentEscapesUsingEncod...

Streamwriter writes but gives web exception

Hi - I am trying to insert data via web service. The code below writes to the database; however, I have an error (see bottom). What goes wrong here? and how to fix it? //Create the web request HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri); //Set type to POST request.Method = "POST"; request.ContentType = "text/XML"; ...

How can I invoke a post from VB code to an iframe on a page?

Hi, I've written the code to post the information to a page, however I don't know how to make the post target the iframe I've placed on the page. (I haven't tested this code so I'm not sure if the post even works) Dim param1, param2, result, url As String Dim request As HttpWebRequest Dim paramStream() As Byte Dim reque...

How secure is a HTTP GET when the data is URL Encoded?

If the data is Url Encoded, is it secure enough to send login credentials over HTTP GET? ...

How secure is a HTTP POST?

Is a POST secure enough to send login credentials over? Or is an SSL connection a must? ...

Is there a way to determine if a redirect occurrs during a WebRequest?

I'm using HttpWebRequest to scrape Wikipedia.org. A lot of times there will be links to topics on a page that have been consolidated and therefore they redirect you to the correct page. for example http://en.wikipedia.org/wiki/Polish_prisoners_of_war_in_Soviet_Union_(after_1939) redirects you to the correct topic which is http://en....

Asynchronous HTTP Client for Java

As a relative newbie in the Java world, I am finding many things frustratingly obtuse to accomplish that are relatively trivial in many other frameworks. A primary example is a simple solution for asynchronous http requests. Seeing as one doesn't seem to already exist, what is the best approach? Creating my own threads using a blocking t...

HTTPS C# Post ?

Hi Guys, I am trying to login to a HTTPS website and then navigate to download a report using c# (its an xml report) ? I have managed to login OK via cookies/headers etc - but whenever I navigate to the link once logged in, my connection takes me to the "logged out" page ? Anyone know what would cause this ? ...

HTTPS C# POST 302 Moved

Guys, I am trying to create a script that logins to a webpage and grabs a report - all is working GREAT except - I am getting a HTTP/1.1 302 MovedTemporarily Date: Mon, 22 Jun 2009 13:22:04 GMT Server: Server x-some-id-1: 0J3X3VBBCGNJG9V46G5D x-some-id-2: BtQ4SsDhbryWgiVNFcVpMbt898GuPIBaWuGwAWjvsyI= Set-cookie: session-id-time=1246258...

Httpwebreqest works with Fiddler On otherwise Timeout

Hi Guys, I am getting a weird error. I have setup a script that works perfectively when Fiddler is open - it downloads a report from a website using httpwebrequest and everything works fine! HOWEVER it only works when Fiddler is open ? When fiddler isnt working I just get a "Request Timeout Issue" Does anyone know how to fix this and ...

Httpwebrequest and Fiddler

Hi Guys, So I have setup a httpwebrequest using HTTPS and the code is working fine when fiddler is running. When Fiddler isn't running - I get a "request timeout" error. Does anyone have any ideas what would be the cause? I have a) Ensured that security policy exists as per if (this.IngoreCertificateErrors) ServicePointMan...

HTTPS C# Post Problem (with Fiddler)

Hi :) Basically I have this code below & the last step FinalStepGetReportData() throws an exception on return (HttpWebResponse)request.GetResponse(); if fiddler is switched off? All else works when Fiddler is OFF except this last step. When I turn Fiddler on the final step works ? Any ideas? I am banging my head against the wall. Th...

HttpWebRequest and HttpWebResponse : maintaining state of logged in request for consecutive queries

Hi, I have a few HttpWebRequests and HttpWebResponses chained together, also using CookieContainer. The code simulates a user going through three different 'I agree' pages which set the cookie info, logging in with username and password on a fourth, and doing a POST (search) on the fifth returning the response as a string. Is there a ...

How to determine Session Timeout using when reusing CookieContainer

I have the following code which re-uses a CookieContainer which logs in on the first request, but just uses the cookie container for requests after. After a period of time if idle the site will give a Session Timeout, I will need to perform the login again. Q: Can I determine (with the cookie container object) if the timeout has happen...

C# - how to download only the modified part of an HTML

Hi all. I'm using C# + HttpWebRequest. I have an HTML page I need to frequently check for updates. Assuming I already have an older version of the HTML page (in a string for example), is there any way to download ONLY the "delta", or modified portion of the page, without downloading the entire page itself and comparing it to the older ve...

System.Net (HttpWebRequest) tracing without using files or app.config?

I want to capture certain, but not all, HttpWebRequest traffic in my application for debugging purposes. It's a web service hosted by IIS. I have read How to: Configure Network Tracing. This works great, but I don't want to direct the trace to a file, due to possible permission problems on the file system, data sensitivity, etc. I wo...

How to parse HttpWebResponse.Headers.Keys for a Set-Cookie session id returned.

Hi, i'm trying to create an HttpWebRequest/HttpWebResponse session with an ASP.NET website to later parse an HTML form through url params (this part i know how to do), but I do not understand how to parse and set a cookie such as the session id. In Fiddler, it shows that the ASP.NET Session ID is returned through Set-Cookie in the respon...

.Net CF 2.0 HttpWebRequest pre-authentication and sending credentials on first request.

I'm attempting to communicate with bit.ly's REST API using their modified version of basic authentication. However in order for this to work HttpWebRequest needs to attach the credentials on the first request, however, HttpWebRequest will not send credentials on the first request and will wait for a 401 before sending any credentials eve...