http

Is getting post data from HttpListenerRequest asynchronously possible?

Hi, msdn give's us this example to retrieve the post data. public static void ShowRequestData (HttpListenerRequest request) { if (!request.HasEntityBody) { Console.WriteLine("No client data was sent with the request."); return; } System.IO.Stream body = request.InputStream; System.Text.Encod...

How to send password securely over HTTP?

If on a login screen user submits a form with his username and password, the password is sent in plain text (even with POST, correct me if I am wrong). So the question is what is the right way to protect the user and his password against the third party who might be eavesdropping on the communication data? I am aware that HTTPS is aso...

Unable to assemble multipart/form-data request

Hi community! I'm trying to implement file upload functionality in the iPhone app. Server code is tested and works when files are uploaded from the desktop browser, so I moved to implementing the Objective-C client code. I'm assembling HTTP requests body manually, and despite that it looks correct, it is rejected by the server (server h...

304: Not modified and front end caching

I am using a PHP script to serve files. I would like to be able to send back a 304 not modified header in my http response if the file has not changed since the client last downloaded it. This seems to be a feature in Apache (and most other web servers), but I have no clue how this can be implemented through PHP. I have heard of using ...

Best practices to deal with absent/wrongly typed GET variables?

What do you do when you detect your get request is broken or is passing wrong types of data? Say you have a forum-page.php?forum=3 that lists all the topics related to forum 3. What would be a good way to deal with the absence of the "forum" variable? What about if instead of being an integer, you would get a string? How would you respo...

PHP POST with header() and Bad header problems

I've come across a dumbfounding issue with sending headers in PHP. I've spent about 45 minutes reading on SO and other sites and I can't come up with a legitimate reason for my problem. I need to send a POST request to another server and I'm using the PHP header() function to set the values. I have sample code below. $server = '...

Unusual HTTP Response in Basic C++ Socket Programming

I've got a basic HTTP client set up in C++, which works ok so far. It's for a school assignment, so there's lots more to do, but I'm having a problem. I use the recv() function in a while loop, to repeatedly add pieces of the response to my response buffer, and then output that buffer each time. The problem is, at the end of each piece ...

are there some libraries like java httpclient in ruby

hi all, i want to know whether there are libraries like java httpclient in ruby? great thanks. ...

Retrieve date/time of an http request

Is it possible to retrieve the date/time of a request in ASP.NET (preferably VB.NET)? I have tried HttpContext.Current.Request.Headers.Get("date"), but it returns nothing (null). ...

Applet HttpUrlConnection Chunked Response problem

I have an Applet with HttpUrlConnection to IIS 6.0 Server. Server response chunked data, but sometimes (some browsers) i have a problem. Server answers stick in certain buffer, and arrive at me when the server close connection by timeout. url = new URL(urlStr); huc = (HttpURLConnection) url.openConnection(); huc.setDefaultUseCaches(fa...

Does the common HTTP server implementation decompress POSTed form data?

If I GZip the a POST request form data, will a HTTP server decompress it, or it only works the other way (server -> client)? ...

How to get AppID on iPhone using SDK/programmatically?

Hi All, I want to send the AppID as a http URL parameter for all webservice requests, but I do not know how to get the AppID on iPhone programmatically. Does Apple provide any API to obtain the AppID? Somebody please help. ~Neeraj ...

Show busy gif after user clicks on a Link

I have a large excel document that is generated when the user clicks on the download link. When the download link is clicked the browser pops up the standard open save cancel dialog. The problem is that the wait time can be really long e.g. 15 seconds or more before the dialog appears. I want to show a busy gif while the request is in pr...

HTTP Preauthorization

At http://localhost/tmp/ I have a form that asks for the user and password (authentication). After the user posts (hits OK) I want to redirect the user to http://localhost/test/ which uses Apache's Basic AuthType. Happens that the user and password just typed in the form are exactly the credentials to authenticate at http://localhost/tes...

Mixing GET with POST - is it a bad practice?

Is it a bad practice to mix GET and POST? (note this is in PHP) e.g. <form action="delete.php?l=en&r=homepage" method="post"> <!-- post fields here --> </form> ...

Does sending POST data to a server that doesn't accept post data recieve the data?

I am setting up a back end API in a script of mine that contacts one of my sites by sending XML to my web server in the form of POST data. This script will be used by many and I want to limit the bandwidth waste for people that accidentally turn the feature on without a proper access key. I will be denying requests that do not have the...

Firewall / visited websites logger

Hi. I have a firewall implementation and I want to log all the websites visited on the machine. So when the user enters an address in the browser(any browser) or clicks a link to be able to log the visited address. The problem is that I want to log only the visited address and NOT the other resources requested by the page (ads, iframe...

how do tell if a user hits my site from my free domain name

I've registered two free domain names, one at .co.nr and the other at .tk (yeah I realise the .co.nr one is really a subdomain) Anyway I have both pointing to the same site mysite.com. I want to find out which one brings in more traffic. Not knowing much about how dns and the above sites operate, how do I go about telling in mysite.co...

URL parsing in ASP.NET

I'm trying to parse a URL, but I'm having problems: http://www.meteor.gov.tr/deniz/deniz-suyu-sicakligi.aspx When I call HttpWebRequest it throws a exception: System.Net.Sockets.SocketException: Eine vorhandene Verbindung wurde vom Remotehost geschlossen In english: System.Net.Sockets.SocketException: a existing con...

request.format returning */*

Good afternoon, I'm currently developing an API for my application on RoR As an example, I created some XML, loaded with all the info I need to create the object, let's say a Person, and using Curl I submitted it to my application I'm able to call exactly the create action I want from the controller and the hash params of the object a...