http

What's the preferred method for authenticating users of a webpage in a RESTful way?

I'm developing a new experimental web-application framework, and I decided to give RESTful some attention. I've read up on the basics, and feel like I have a pretty good understanding of RESTful as a concept. I've got a system up and running, using URLs strictly to define 'nouns' in the system and take the 'verbs' from the HTTP request ...

Response.ContentType sporaticly changes for IE8 using ASP.NET MVC

We are running ASP.NET MVC on IIS6. We have started to notice a problem with IE8 clients. Almost all the time, the ContentType returned is 'text/html' but occasionally, it will be returned as 'application/xhtml+xml'. This is causing IE8 to try and download the file instead of rendering the contents in the browsers. I can't find any re...

Tomcat basic auth

I've got an existing WAR file that is not developed by me. I deploy the application to the Tomcat server and after that it is accessible for everybody. Which is not good. I need to restrict the access to the context with HTTP Basic auth. What is the best way to do that? I do not need any sophisticated user management system I just need a...

htaccess redirect for non-www both http and https

Not sure if this is possible in a single .htacess file, but ideally, I'd like to have: http://example.com redirect to: http://www.example.com https://example.com redirect to: https://www.example.com And anything that is http://whatever.example.com NOT append the www like http://www.whatever.example.com. Is this possible? Thanks, D....

POST with links without JavaScript

Let's say I have a calendar on my page and clicking on a day would mark that day as complete. But I want to use POST and not GET, since GET is not suitable for this kind of stuff (changing something). And I also don't want to use JavaScript. What I'm going for here is to build a page that will work without JavaScript (which I will use t...

Getting Binary HTTP Post parameter in an Java/Tomcat/HttpServlet

I have a binary value being URL Encoded, and then POSTed to an HttpServlet. The following code shows how I first attempted to extract this data. Very simple except that the result is a String, not bytes. This seemed to work at first, except that an extra byte appeared three bytes from the end. What I eventually figured out was that my d...

Post multipart request with Android SDK

Hello all, I'm trying to do something I thought would be relatively simple: Upload an image to a server with the Android SDK. I'm found a lot of example code: http://groups.google.com/group/android-developers/browse_thread/thread/f9e17bbaf50c5fc/46145fcacd450e48 http://linklens.blogspot.com/2009/06/android-multipart-upload.html But n...

Filtering HTTPS traffic?

Is it possible to filter HTTPs traffic? For example via a TDI filter? Or perhaps you need to use a proxy? This product seems to do filtering of HTTPS traffic and I'd like to know how it does it, as well as if this is the only way. How about via the Windows Filtering Platform for Vista and up? ...

HTTP/S proxy starting point

I would like to make an HTTP/S proxy program to filter/deny certain http traffic based on how I parse the HTTP request in C++. Is there some kind of starting point code that I can use with an open license for commercial use? For example if I wanted to do a project on searching I would start with lucene. ...

HTTP POST requests in PHP

How do you go about redirecting a browser and sending a HTTP POST request in PHP? A header("Location: file.php?foo=bar") of HTTP POST requests, if you will. ...

How do I post a file over HTTP via public API in ASP NET ?

I have a web application. I am using C#. I have existing methods in my API for various things but all only submit and return bool/int/strings. All of my API methods have the directive System.ServiceModel.OperationContract All the parameters are of System.Runtime.Serialization.DataMember I would like to be able to receive a poste...

Google App Engine, Java, and HTTP Performance

A friend and I are currently working on a turn-based game with chat with both desktop browser and Android clients, with Google App Engine as the server. We're using the Java API for GAE and using HTTP for communication with the server. We've implemented simple chat functionality, and we're getting undesirable latencies 1-3 seconds from...

Download file using urllib in Python with the wget -c feature

Hello, I am programming a software in Python to download HTTP PDF from a database. Sometimes the download stop with this message : retrieval incomplete: got only 3617232 out of 10689634 bytes How can I ask the download to restart where it stops using the 206 Partial Content HTTP feature ? I can do it using wget -c and it works pret...

Is my implementation of HTTP Conditional Get answers in PHP is OK?

After searching a lot, reading every tutorials I've found and asking some questions here, I've finally managed to answer corrctly (at least I think) to if-none-match and if-modified-since HTTP requests. To do a quick recap, this is what I do on every pages cacheable: session_cache_limiter('public'); //Cache on clients and proxies sessi...

JAX/Jersey Custom error code in Response

In Jersey, how can we 'replace' the status string associated with a known status code? e.g. return Response.status(401).build(); generates a HTTP response that contains: HTTP/1.1 401 Unauthorized I (not me, but the client application) would like to see the response as: HTTP/1.1 401 Authorization Required I tried the following a...

How can I createa custom HTTP status code from a WCF REST method?

I would like to return a custom HTTP status code from a RESTful WCF web service when a certain condition is met. I do not want to use the standard HTTP status codes. I would like to maybe return a 514 status code which means something to the calling user. Is this even possible WebOperationContext.Current.OutgoingResponse? ...

Can the HTTP response header Authorization be managed from the server?

Howdy, I'm playing with HTTP Basic Authorization. As we all know, when a client gets a 401 error on requesting a page, the client must collect authorization credentials from the users (typically in the form of a pop-up window). Subsequent requests for resources under that part of the URL will be accompanied by "Authorization: Basic...

HTTP POST vs HTTP PUT

Hi all, Does HTTP PUT have advantages over HTTP POST, particularly for File Uploads? Data transfer should be highly secure.. Your ideas / guidance on this will be of great help. regards, Kingsley Reuben ...

Trying to get HTTP code. Can someone try this code for me in their Python interpretor and see why it doesn't work?

import httplib def httpCode(theurl): if theurl.startswith("http://"): theurl = theurl[7:] head = theurl[:theurl.find('/')] tail = theurl[theurl.find('/'):] response_code = 0 conn = httplib.HTTPConnection(head) conn.request("HEAD",tail) res = conn.getresponse() response_code = int(res.status) return res...

Socket module does not work in my Python

Very simple. >>> import socket >>> socket.gethostbyname('http://yahoo.com') Traceback (most recent call last): File "<stdin>", line 1, in <module> socket.gaierror: [Errno -2] Name or service not known ...