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
0
votes
1 answer

HttpWebRequest collection Initializer C#

When using HttpWebRequest via HttpWebRequest.Create(url) is there an easier way than the following to initialize a HttpWebRequest by using a object initializer: class RequestLight { public HttpWebRequest WebRequestObj; public…
0
votes
1 answer

Wierd C# Error while creating a HTTPWebRequest in a Console Application

I am creating a C# Console Application in which I have to fire a http url to start a process on a hosted Solr Index. The url I am firing is http://ServerName:8888/solr/people-dev/dataimport?command=full-import&clean=true I am using…
Udit Narayan
  • 109
  • 1
  • 7
0
votes
0 answers

Invalid URI: the url is too long

I am trying to pass data to a restful web service which receives data in JSON format. The data I am trying to GET is quite huge, I get an exception as shown below request = WebRequest.Create(url) as HttpWebRequest; The exception is Invalid URI:…
0
votes
1 answer

Adding System.Net.Http.dll reference to windows phone 8 project throwing error

I am beginer to windows phone 8 development. I want to use HttpClient in my app it throws an error to add namespace for that. I am unable to include System.net.http.dll reference to my project when i tried to do that i got this error as shown in…
0
votes
1 answer

WebRequest.Create(uri) with a local html file

I have an application that uses an WebBrowser. This webBrowser load local pages (file://PathOfPage.html). I want to be able to do a request to this page because of I need to get/set cookies in that page. The problem is that if i use like uri…
Bae
  • 892
  • 3
  • 12
  • 26
0
votes
1 answer

I'm facing the error Stream.Length throws NotSupportedException

I am trying to POST some data from ASP.Net application to PHP using HttpWebRequest object. But when I try reading the Request content using Stream myStream = myWebReq.GetRequestStream(); I am getting an error 'responseStream.Length' threw an…
0
votes
1 answer

2 exceptions when trying to make async HttpWebRequest

I am writing an MVC Web API the make async HttpWebRequest calls. I am getting 2 different exceptions. Below is the method I am using. The 1st exception is: "This stream does not support seek operations." and it is happening on the…
Rhonda
  • 985
  • 5
  • 18
  • 32
0
votes
1 answer

Request content from httpclient to WebApi changing between client / server

I'm working on a solution for authenticating WebApi requests with HMAc (Similar to this) Part of this, looks at the outbound requests Content, and generates an MD5 hash of it (this is included as part of the overall hash of the message) In one…
Alex
  • 37,502
  • 51
  • 204
  • 332
0
votes
1 answer

Making an HttpWebRequest from the following given POST data

When it comes to web development, I know very very little... I have found some code and explanations from the following site. https://dev.twitter.com/docs/auth/implementing-sign-twitter Ultimately, I want to implement login with twitter. But I am…
KapteinMarshall
  • 490
  • 6
  • 20
0
votes
0 answers

This method is not supported by this class error @ client.DownloadFile

I get this strange error suddenly saying System.Net.WebException : The request was abborted: The Request was canceled. ---> System.NotSupportedException : This method is not supported by this class . I dont know why is occurring cause it used to …
0
votes
1 answer

C# - WebServiceHost issue with Visual Studio 2012

I am using a WebServiceHost to receive a command object and return a response to a client. I have datacontracts setup for the objects and the client is executed using HttpWebRequest and HttpWebResponse objects. This has all been working fine for two…
0
votes
1 answer

Want to get html content of Microsoft Live Login page

I have url: https://login.live.com/login.srf?wa=wsignin1.0&wtrealm=http%3a%2f%2fcorp.sts.microsoft.com&wctx=7b4cd04b-7dc2-4880-9f77-20c8c6ef64c4&wct=2013-03-11T06%3a54%3a42Z&whr=uri%3aWindowsLiveID. I want to get htmlcotent of this webpage as…
0
votes
1 answer

How can I validate IP address in response from HttpWebResonse?

I'm working on Payment Gateway for large e-Commerce site which is based on ASP.NET MVC3(C#). I've have PG Server IP address that they provide me for validation. but I'm concern about Response. I'm requesting to PG by below code. HttpWebRequest…
-1
votes
1 answer

C# HttpWebRequest returns 503 error for localhost url

I am calling localhost URL using C# HttWebRequest. It is returning a 503 service unavailable error in response. HttpWebRequest req = (HttpWebRequest)WebRequest.Create(new Uri("http://127.0.0.1:42000/some/path")); req.Method = "POST"; byte[]…
anujprashar
  • 6,263
  • 7
  • 52
  • 86
-1
votes
1 answer

Code Works Fine But I am still not able to login into IRCTC Website

Everything Working Properly but we click on submitData() button i will show me login page instead of myhomepage, so very first I navigate login page it will set the cookie, then cookie stored in cookie container code is CookieContainer cookieJar =…
Abhishek kushwaha
  • 1,429
  • 12
  • 13
1 2 3
12
13