httpwebrequest

Getting a Request.Headers value

Very simple I'm sure, but driving me up the wall! There is a component that I use in my web application that identifies itself during a web request by adding the header "XYZComponent=true" - the problem I'm having is, how do you check for this in your view? The following wont work: if (Request.Headers["XYZComponent"].Count() > 0) Nor...

WebRequest bug?

EDIT: Solved, the problem was server-side. I'm using C# and .NET2 and I wonder is that a WebRequest bug.. I do several good requests with this method and all is fine, but after that every time I get "The operation has timed out.". I really don't understand why is that. public string RequestPage(string url) { HttpWebRequest req ...

ASP.NET: How do I open an external website page whose login credentials I have?

Platform: ASP.NET 4.0, VS 2010 My scenario is this I have the credentials of an external website I do a couple of GET/POST to scrape some data off of it Depending on something that I find, I want to give my user a hyperlink that, when clicked, takes him 3 levels deep into the target website beyond the login page Of course, I could j...

VB.NET HttpWebRequest POST

Hey whhat's up. I've been looking at some example source codes but I can't quite figure it out. I'd like to send a POST request to login to a website with my account. For an example, how would I login to this website using HttpWebRequest.. http://z4.invisionfree.com/cotec/index.php? It's for an application I'm building for my clan wher...

Generating HTTP Request

Hi, In how many ways can an HTTP request be generated? Regards Adeel ...

Should I use a mixture of POST and GET for this form sequence?

I have a sequence of forms that follows the following algorithm: Form #1 Prompt for input of value A. Send X* request with value A. Form #2 Display value A and prompt for input of value B. Send POST request with value A and B. *Should X in step 2 be GET or POST? I was just going to make it POST, but hesitated and wondered if I s...

Login to different accounts viz. yahoo/gmail/facebook

I have a problem: take username and password from user from text filed. Automatically sign in to yahoo/google/facebook account and display the webpage in webview. Basically I dont want user to directly put username and password to yahoo account but go through my application. Here is my code: String login = "abcd"; String pwd = "123...

parts of an asynchronous httpwebrequest

There are many pieces related to an httpwebrequest that can go asynchronous. I recall reading a question here about this very topic, but I can't seem to find it any more. So I'll re-ask the question. Which of the following get the most bang for the buck (so to speak). BeginGetRequestStream/EndGetRequestStream BeginWrite/EndWrite Begin...

.NET 4 Async WebRequest Vs Mutiple Threads

I'm using C# .NET 4 and MSSQL. I'm writing a code that downloads the html of different websites and analyses it using Regex. Most of the time it takes the code to execute is waiting for the website html download to finish. Currently i'm using Task.Factory.StartNew to create multiple threads that call DownloadHtml() . DownloadHtml use...

.NET WebRequest Throttling

I'm using C# .NET 4 and MSSQL. The code uses WebRequest to download the html of different websites. The code is multi threaded. I want to limit the number of requests per mintue for a pre-defined list of domains. For example Domain: www.domain1.com Request Per Min : 5 Domain: www.domain2.com Request Per Min : 20 i saw some questio...

File-get-contents failed to open stream Unauthorized

I am trying to use file_get_contents.I have made sure that allow_url_fopen is enabled in php.ini. As of now it is telling me: [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.1 401 Unauthorized All I'm doing is the following, which I can access through browser without a problem. $url=('http://site/@api...

Unhandled exception while downloading web page using HttpWebRequest and StreamReader

This is a C# app using .NET 4.0. Background: I have been trying to refine a portion of an app which downloads files from multiple web servers. Everything is working pretty well except for an occasional situation wherein the remote computer closes the connection. I assume this may be due to a variety of factors, including network proble...

SharePoint 2010 / IIS 7.5 Byte-Range Request Responds With Entire File

Hello, I'm having problems getting SharePoint 2010/IIS 7.5 to respect byte-range requests. I'm developing a SharePoint 2010 Web Part using Silverlight, and am trying to retrieve part of a document stored inside SharePoint. When I request a byte range of a file in SharePoint, the server responds with the entire file. However, if I reque...

How to get a response from a local server

I am working on blackberry eclipse. I need to get an session ID after sending an HTTP request and I have to parse that data through JSON. Can anyone tell what is wrong with this code? private void l()throws IOException { // TODO Auto-generated method stub //Dialog.alert("click continue"); HttpConnection hconn = null; ...

See HttpWebRequest as string before GetResponse without using fiddler

How can i see HttpWebRequest object as string before calling GetResponse method? I want to see raw format of request something like this as in fiddler: Content-Type: multipart/form-data; boundary=---------------------------2600251021003 Content-Length: 338 -----------------------------2600251021003 Content-Disposition: form-data; name...

http request in windows service.

How can we implement like this request: http://nominatim.openstreetmap.org/reverse?format=xml&lat=52.5487429714954&lon=-1.81602098644987&zoom=18&addressdetails=1 in a windows service. what we are trying to do is this: run a request from windows service, and when we get the response back,we will save to DB? Edit: the ...

HttpWebRequest takes a long time to send when there are a bunch at once from client

I am attempting to load-test a Comet-ish server using a C# load testing client that creates many HttpWebRequests (1000+). I am finding that after a few minutes, randomly, the server takes a long time to receive some of the requests. The client thinks it sent the request successfully, but it actually takes 40s to arrive at the server, at ...

Uploading to Imageshack with VB.NET

I want to use the http://www.imageshack.us/upload_api.php API function to upload a picture onto ImageShack and then obtain the image_link. The only problem is, how do you place an image with its file name with the form-data along with the API key? This is what is stumping me in trying to implement the function. By the way, OpenDialog is...

WebRequest- retrieving data asynchronously for multiple requests

The code is not complete (It does not build), as I am not able to get the "item" in the following line in the WriteResponseData(). HttpWebResponse WebResp = (HttpWebResponse)item.EndGetResponse(result); I must be missing something. Please point out. below is the complete code:- static string[] imageUris = { "http://www.crici...

HTML scraping: Forms authentication failed for the request. The ticket supplied has expired

The ActiveForums module we're using as part of our DotNetNuke system has a bug in the XML for it's RSS feed. It doesn't correctly encode ampersands, it leaves them as & rather than encoding them as & I've reported the bug to the company, but in the mean time I need a fix. So what I've done is create an intermediary page that makes a...