httpwebrequest

Cannot handle redirect from HTTP/HTTPS protocols to other dissimilar ones

Basically, I'm trying to grab an EXE from CNet's Download.com So i created web parser and so far all is going well. Here is a sample link pulled directly from their site: http://dw.com.com/redir?edId=3&siteId=4&oId=3001-20_4-10308491&ontId=20_4&spi=e6323e8d83a8b4374d43d519f1bd6757&lop=txt&tag=idl2&pid=105...

Download file for reading question using HttpWebRequest

If I have a URL to a download, www.website.com/myfile.html so when that link is clicked it automatically starts a download, which may be myfile.txt for example, how would I get that file into C# for reading.. Is that what Net.WebRequest.Create(url), Net.HttpWebRequest does? ...

Capture output from browser call using Selenium

I need to create a use case (using Selenium) in which I send HTTP calls with a Cookie through the browser and capture the return value in a text file. What do I need to do this, I have run this using CURL in the command line, but we are encountering issues with the same, and hence wish to verify using a real UI browser. Another thing t...

WCF Manual SOAP POST using HttpWebRequest over https with Usertoken

Hi, I'm writing a client that calls a number of WCF webservices (written externallyt to my company) that are very similar in structure. The design I was hoping to use is to manually build the SOAP message from XML chunks that are stored in a database and then processed through a generic web service handler class. I have access to the WS...

Silverlight 4 HttpWebRequest user agent string is null

The problem I have a page with a silverlight object. It attempts to retrieve XML from another (external cross domain) page. But I am struggling with a security exception. I have this code working brilliantly in WPF. When using a website hosting a silverlight application with the same code, the user agent string of the HttpRequest obj...

Problem with reCaptcha and .NET

Hi, I get this error with reCaptcha: 'Input error: response: Required field must not be blank challenge: Required field must not be blank privatekey: Required field must not be blank' I'm sending the data via POST, so I don't understand what is going on. This is the code I use: public static Boolean Check(String challenge, Strin...

Programmatically automating a web login

I am trying to create a C# Winforms application that will automatically log me into a site and download data. Specifically, I want to have my application automatically log into my online banking site, log me in, and download my transaction history. I can do this manually by logging in through a web browser and downloading it. I am trying...

Get the .ASPXAUTH cookie value programatically

Is there a way to get the .ASPXAUTH value programatically. Example I login to a website with my own credentials (POST) and then read the response...it does not return the .APSXAUTH in the CookieContainer that I use to track the session. Anyone has a clue how can I get it and send it with the subsequent gets and posts? [EDIT] here's wh...

Use HttpGet with illegal characters in the URL

I am trying to use DefaultHttpClient and HttpGet to make a request to a web service. Unfortunately the web service URL contains illegal characters such as { (ex: domain.com/service/{username}). It's obvious that the web service naming isn't well written but I can't change it. When I do HttpGet(url), I get that I have an illegal characte...

Is it possible to use JSONP on the server?

Hi all, I'm stuck on a clients host that has medium trust setup which blocks cross domain requests and need data from a 3rd party domain. I now have the option to use JSONP. I've used JSONP from the client with jQuery to get around the browsers cross domain security and I've used HttpWebRequest in ASP.Net 3.5. Is it possible to use J...

HttpWebRequest response produces HTTP 422. Why?

Hi there. I'm trying to programmatically send a POST-request to a web-server in order to login an then perform other requests that require a login. This is my code: byte[] data = Encoding.UTF8.GetBytes( String.Format( "login={0}&password={1}&authenticity_token={2}" +"&login_submit=Entra&remember_me=1", ...

How to emulate a real http request via cfhttp?

Hi, I need to emulate a real http request via cfhttp. I was getting rss feed with ColdFusion, but tonight they started to block my request and send an index page in response instead of rss fead. I added useragent for cfhttp, but it doesn't help. Opera, Firefox and Chrome open feed correctly from the same computer. ...

HttpWebRequest.GetResponse() - what specific status codes cause an exception to be thrown?

I've hunted around for some definitive documentation on this but haven't had much luck finding any. Basically - the question is - for which HTTP Status codes coming back from the server will HttpWebRequest.GetResponse() generate a WebException after doing something like say, a POST? Specifically - will it generate a WebException for an...

A question about path info

domain.name/index.php/pathinfo.php works but domain.name/image.jpg/pathinfo.php will give a 404, where domain.name/image.jpg DOES exists,why? ...

Get html that is generated via AJAX in webclient

I often go to a site to look stuff up. I thought to myself: "Hold on. I can program. Why am I going to this site manually when I can write a piece of software that does it for me?". And so I started. I'm using C#, so I found WebClient and Uri. I've managed to get the source code for the site, yet the problem occurred that the specific ...

«HTTP::Message content must be bytes» error when trying to post

I have the following code: ... sub setImage { my $self=shift; my $filename=shift; unless(-r $filename) { warn "File $filename not found"; return; } my $imgn=shift; my $operation=&URI::Escape::uri_escape_utf8( (shift) ? "Удалить! (Delete)" : "Сохранить! (Store)"); my $FH=&::File::open($...

Implementing PreRequestHandlerExecute and multiple asynchronous calls

I'm having trouble getting this to work correctly. It seems that if I shoot off multiple asynchronous calls in the begin function, no matter what I do, I only get one of them in the end function. How can I set this up to do more than one call? If I use the same callback for all function, they all complete (I can write to a file and all ...

How a web app identify if a click came from another web app via code?

Hi, we have a web application that users can take online reports from ou ERP system data... And we have another web application that is used by our teachers and employees. We can't change the ERP web app because its a closed DLL, in this case we made some extended functionality in our custom internal web app and we are willing to put t...

Silverlight 4.0 - HttpWebRequest throwing ProtocolViolationException.

I am getting a "System.Net.ProtocolViolationException: Operation is not valid due to the current state of the object." error when trying to call var request = (HttpWebRequest)WebRequest.Create(uri); request.Method = "GET"; request.ContentType = "text/xml"; request.BeginGetRequestStream(RequestCompleted, request); ...

Security when writing a PHP webservice?

I am writing a web service in PHP for the first time and had ran into some security problems. 1) I am planning to hash passwords using md5() before I write them to the database (or to authenticate the user) but I realize that to do that, I would have to transmit the password in plaintext to the server and hash it there. Because of thi...