Questions tagged [system.net.httpwebrequest]

Provides an HTTP-specific implementation of the WebRequest, an abstract base class for the .NET Framework's request/response model for accessing data from the Internet class.

Provides an HTTP-specific implementation of the WebRequest, an abstract base class for the .NET Framework's request/response model for accessing data from the Internet class.

The HttpWebRequest class provides support for the properties and methods defined in WebRequest and for additional properties and methods that enable the user to interact directly with servers using HTTP.

HttpWebRequest exposes common HTTP header values sent to the Internet resource as properties, set by methods, or set by the system; the following table contains a complete list. You can set other headers in the Headers property as name/value pairs. Note that servers and caches may change or add headers during the request.

http://msdn.microsoft.com/en-us/library/system.net.httpwebrequest.aspx

182 questions
2
votes
1 answer

System.Net.WebException : The remote server returned an error: (403) Forbidden

When I am behind my company's firewall and using C# to interact with a website I am receiving System.Net.WebException : The remote server returned an error: (403) Forbidden. However, I can open Internet Explorer on the very same computer and I do…
sapbucket
  • 6,795
  • 15
  • 57
  • 94
2
votes
1 answer

HttpWebRequest force new connection

I want to download large file from limited-transfer server using several threads with HttpWebRequest.AddRange(int, int). The problem is that all my threads but one get blocked on GetResponse(), probably becouse they want to reuse the connection of…
noisy cat
  • 2,865
  • 5
  • 33
  • 51
2
votes
1 answer

Downloading data with broken header

I just got the following problem: I need to download data which is behind a login page. When I however make my get request, the server is providing bad data - the content is there, but no content length in header set, its an empty field. I looked it…
Petr Osipov
  • 621
  • 6
  • 16
2
votes
2 answers

How to deserialize a JSON response with list of objects with variable name starting with _ or $

How to deserialize the web response like this: [{"_exp":"2014-06-05T23:58:03.859Z","_id":"123","$val":"dabg"}, {"_exp":"2014-07-05T23:58:03.859Z","_id":"143","$val":"dabg"}] Here my specific question is that I am not able to create a response…
2
votes
2 answers

send httprequest in order to receive some data

I have some difficulties in requesting an access token from an other server. A request to get that is: POST /auth/O2/token HTTP/1.1 Host: api.amazon.com Content-Type: application/x-www-form-urlencoded;charset=UTF-8 …
2
votes
1 answer

Call an aspx page in silverlight, without open it

I have, in my silverlight application, a call to a aspx page, to create and register a txt file on a directory. Uri ub = (new Uri(HtmlPage.Document.DocumentUri, "GenereInfos.aspx?&connexion=" + connexion + ";&id=" + this.Id)); if…
provençal le breton
  • 1,428
  • 4
  • 26
  • 43
2
votes
1 answer

WebRequest.GetResponse() Times Out After A Couple of Requests

I'm calling a third party web API to update some of our data on their side. I've been submitting about five jobs in quick succession and, without fail, the first two requests are working properly. The last three however never update. The application…
elucid8
  • 1,412
  • 4
  • 19
  • 40
2
votes
1 answer

C# System.Net.WebRequest HTTP Request Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host

Before I get started First let me apologize in advance if this is a duplicate question as there appear to be several questions related to 'Existing connection was forcible closed by the remote host', however I can't seem to get any help from these…
pat8719
  • 1,700
  • 1
  • 26
  • 47
2
votes
3 answers

Which IP does .NET HttpWebRequest use if DNS entry is bound to multiple addresses

I'm using a System.Net.HttpWebRequest to hit an API application hosted within AWS behind a load-balancer. The LB has 6 instances, 3 in 2 different AZs. As a result, the DNS entry for the LB has 2 IP Addresses (1 for each AZ). When I run my C# app,…
2
votes
4 answers

How to Skip HttpWebResponse 404

Hi i have a program thats looking on some pages for (int i=1; i < 1000; i++) { string id = i.ToString(); string url_source = get_url_source("http://mysite.com/"+id); } and a method public static string get_url_source(string url) { …
2
votes
0 answers

facebook c# sdk proxy setting

I have been trying to add proxy setting options for my facebook app. I am using the C# SDK latest and testing with sample code from the SDK. I have set up a proxy server to test with and when I request data using http, I see the result data coming…
2
votes
0 answers

HttpWebResponse displays siteminder login even though URLs are configured to be by passed in Siteminder

I am stumped on this problem and have come humbled to the experts on advice for my problem. I have an ASP.NET MVC app that is Siteminder enabled. In addition, this app has a section of URLS that are web services which provide data to another…
1
vote
0 answers

HttpWebRequest from basic to modern authentication

I have a script dat i want to convert to modern authentication. I cant find the right properties to do it. Could you help me? HttpRequestCachePolicy policy = new…
Mars
  • 11
  • 2
1
vote
1 answer

How do I read Little Endian encoded files in C#?

I have a stream coming in from a HttpWebResponse and when I am using the code below to read and basically re-create the file on my local machine. string sx = ""; using (HttpWebResponse response = (HttpWebResponse)request.GetResponse()) { using…
1
vote
1 answer

HttpClient.PostAsync not complete with wrong DNS server , ios app frozen

Steps to Reproduce Setting wrong DNS at Ipad wifi setting (ex: 5.6.7.8) Run App, Request HttpClient.PostAsync App Frozen Expected Behavior Response Error in Catch() Actual Behavior App Frozen Environment Microsoft Visual Studio Enterprise…
1 2
3
12 13