httpwebrequest

WebRequest problem, response before request-body

Hi, I'am using the WebRequest class in .net and POST data to a server which is responding with a Response. The wierd thing is that its working when I started fiddler to analyze my network traffic, but without fiddler it isn't. So i started to analyze the package which is sent to and from my computer with WireShark. With in this progr...

How to get the web app root?

Hi guys, I am using this to get the application root and was wondering if this is a newer better way to do it? string root = HttpContext.Current.Request.Url.GetLeftPart(UriPartial.Authority) + HttpContext.Current.Request.ApplicationPath.TrimEnd('/'); ...

Add documents using c#

I am trying to add document to the index using c# (xml) but I am always getting error 400 (Bad request). Any ideas what I am doing wrong? Code: private static string GetXml() { XDocument document = new XDocument( new XDeclaration("1.0", "UTF-8", "yes"), new XElement("add", new XEl...

What is the different between the web server and CalDav server?

Hi, everyone, I want to ask some basic knowledge of server. 1) What is the different between the web server and the CalDav server? 2) How to set the web server and CalDav server? 3) If I send a request to CalDav server ( I assume that I have the URL of the server), will the response header contains the data within the CalDav server...

When I pass xml string as a request i get an Bad Request exception in WCF REST?

Client: string value = "<?xml version=1.0?><person><firstname>john</firstname><lastname>smith</lastname> <person/>"; using (HttpResponseMessage response = m_RestHttpClient.Post("new/customerxml/"+value2, frm.CreateHttpContent())) { } Server: [OperationContract] [WebInvoke(UriTemplate = "new/customerxml/string={value}", Method = "...

What are the way to avoid http service error in flex ?

In my project used quick search for character based send request to server , But on time the user fastly type then i got http service error So i want to know how avoid that problem or any possiable to avoid continue request to server or any message queue technical for that problem . kindly give suggestion it's helpful to all ...

In c# convert anonymous type into key/value array?

I have the following anonymous type: new {data1 = "test1", data2 = "sam", data3 = "bob"} I need a method that will take this in, and output key value pairs in an array or dictionary. My goal is to use this as post data in an HttpRequest so i will eventually concatenate in into the following string: "data1=test1&data2=sam&data3=bob"...

Trouble with ASP.NET HttpWebRequest POST to a site

ASP.NET 4.0 Need some help with this vexing HTTP POST problem - I have looked at other posts on Stackoverflow but to no avail. Problem summary: It's a classic case - I want to login to an external site which takes 2 parameters to login, and I need to use a POST to do it What happens: I do a POST and the HTTP response that comes back ...

vexed! POST returns a 302 found object moved error in HttpWebRequest

Someone please help - been struggling with this lousy problem! What I'm doing - I have an ASPX page from which I originate a GET and then a POST to a HTTPS page with a view to login to it. I have spent quite a bit of time comparing my GET and POST construction to a browser GET/POST using fiddler (protocol analyzer) and my requests are f...

Secure online-game http get/post request (How to avoid repeated sending of the same http-req)

In my game/app (iPhone) the client side sends http requests (get or post) to the game http server. Requests have this form: gameserver.com/userId/givebonus/100 This for example would give the userId a bonus of 100. Now, we encrypt the server request and it will become something like: gameserver.com/42c34c234c234/ghjghjg4hj32g42jh2/42...

Storing an image from a webservice

I am accessing an API that returns a favicon for a specified domain (http://getfavicon.appspot.com/). I have a long list of domains that I want to get Icons for and don't want to make the call to the web service every time, so I figured I would get the response and store the image either on the file system or in a DB Blob. However. I d...

Why does HttpWebResponse return a null terminated string?

I recently was using HttpWebResponse to return xml data from a HttpWebRequest, and I noticed that the stream returned a null terminated string to me. I assume its because the underlying library has to be compatible with C++, but I wasn't able to find a resource to provide further illumination. Mostly I'm wondering if there is an easy w...

Getting "underlying connection was closed" on HttpWebRequest

Hello all... I have an application written in VB.NET (NOT asp.net, it is a Windows Console app). I am trying to call a url (an html page) and get back the response into a string. The response is straight JSON, no html tags whatsoever. It opens with { and closes with }. I create the HttpWebRequest object fine. Then call req.GetResponse(...

how to ensure that our site authenticates with kerberos

I am working with HttpWebRequest in dotnet. I am using delegation (impersonation) to do this, request.Credentials = CredentialCache.DefaultCredentials; request.ImpersonationLevel = System.Security.Principal.TokenImpersonationLevel.Delegation; in webconfig file identity impersonate="true" for Impersonation Kerberos is required... So ...

window.open prevent new http request

Hello I have an asp.net web application. Some of my users report me a problem that I can’t understand why that occurred. I have a menu on main page and users choose which services they need. When click on menu item. It open a new full screen window. I used java script for this purpose. window.open('URL "', 'CustomPopUp', 'fullscreen=yes,...

Make in HTTP request with android

Hi all, Have search everywhere but I couldn't find my answer, is there a way to make an simple HTTP request? I want to request an PHP page / script on one of my website but I don't want to show the webpage. If possible I even want to do it in the background (in an BroadcastReceiver) ...

Intermittent exception: java.net.UnknownHostException: profile.ak.fbcdn.net

I try to retrieve a picture from e.g http://graph.facebook.com/btaylor/picture using the following code: DefaultHttpClient httpClient = new DefaultHttpClient(); HttpGet request = new HttpGet(urlString); HttpResponse response = httpClient.execute(request); return response.getEntity().getContent(); but occasionally I get the exception...

Get the .ASPXAUTH cookie value programatically II

I am attempting to retrieve the ASPXAUTH cookie pro grammatically without success. A similar question posted to this forum did not prove helpful. My code is shown below. One known gotcha is to be sure to assign a CookieContainer to the request, which I have done. Additionally, I can run web application in the debugger and see that th...

View cfhttp request

I would like to view the actual http request that gets sent via my cfhttp tag. What is the best tool to capture this? Specially, I want to see exactly what headers and content are being sent. ...

C# HttpWebRequest to a HTTPS failed

I am trying to login to this website https://www.virginmobile.com.au programatically (on the right there is a Member Login form). That form works. But when I do a POST request to the form action (https://www.virginmobile.com.au/selfcare/MyAccount/LogoutLoginPre.jsp) it failed. It returns a 302, then following up to the new location, it...