http

Get file size before downloading & counting how much already downloaded (http+ruby)

Can anybody help me to get the file size before I start downloading display how much % was already downloaded . require 'net/http' require 'uri' url = "http://www.onalllevels.com/2009-12-02TheYangShow_Squidoo_Part 1.flv" url_base = url.split('/')[2] url_path = '/'+url.split('/')[3..-1].join('/') Net::HTTP.start(url_base) do |htt...

PNG Sprites with "wasted" empty pixels VS new http requests

Hi! I am merging all my site icons in sprites, but, for some reasons, sometimes I have to add a little white space between some. http://img8.imageshack.us/img8/9793/16spritetest4.png In this image, the icons on left are the ones that need space around them. I wonder what is better for server/user: to split the icons on left from...

JNDI over HTTP on JBoss 4.2.3GA

I've got a remote server on eapps.com that I'm using as my "production" server. I have my own computer at home that I'm using as my "development" server. I'm trying to use JNDI over HTTP to do some batch processing. The following works at home, but not on the eapps machine. I'm connecting to some EJBs (stateless session), and have my jn...

What is the easiest way to implement a Comet serverside backend?

PHP as an Apache module or otherwise, would start one thread per pending request so it doesn't scale well. Are Java and Python my only other options? As a complete newbie to Python, is Twisted easy to use? ...

Sending a File Along HTTP?

Just wondering how I would send a file along HTTP. I'm using HTTPRequest. The data needs to be outputted in its binary form so I can send it in a multipart request. And ideas on how I do it? I'm totally lost. ...

Sending a HTTP post to a web server with Java

As per title really I'm wanting to send a custom HTTP post request to a web server and I have little experience in this area. The web server uses an LDAP server for access control (not sure if that's important) for which of course I know the username and password. Could anyone flesh out some code to do this or at least get me started? E...

Implementing parallel static content download in the browser?

We are looking at adjusting our web pages so we split our calls for static data across sub-domains. In order to do this we must: Always serve the same content from the same sub-domain so it remains cached Try and serve roughly the same amount of content from each of the sub-domains Try to do this in an automatic way on a per-page basis...

Getting raw HTTP response headers

Is there any way to get raw response http header? The getHeaderField() method doesn't work for me, because server spits multiple 'Set-Cookie' and some of them get lost. ...

Encoding detection library in python

This is somehow related to my question here. I process tons of texts (in HTML and XML mainly) fetched via HTTP. I'm looking for a library in python that can do smart encoding detection based on different strategies and convert texts to unicode using best possible character encoding guess. I found that chardet does auto-detection extrem...

gzip without server support?

I have written a css server which does minimization and basic parsing/var replacement. The server is using node.js. I am wanting to gzip my response from this server. As told in IRC, node.js does not currently have a gzip lib, so I am attempting to do it manually from the command line (as I am only gzipping when not in cache). I am pus...

How to Redirect from Http to Https in Intranet?

Hi, I have a vb.net application running as intranet on Win Server 2003. So should I use HTTPS instead of HTTP? What is the difference or why should I if the answer is HTTPS? Is there any code in VB to redirect from HTTP to HTTPS? Thanking you all in advance for your time and consideration. ...

Open source machine readable grammar for HTTP/1.1?

Is there an open source machine-readable grammar for HTTP/1.1 requests and responses? Specifically, i'm looking for a grammar that is accepted by one of the popular parser generators (e.g., ANTLR, CUP, BNFC, ...). ...

Web site performace tools ?

YSlow, dynaTrace, HTTPWatch, Fiddler ......... All these things are really good for measuring the performance of the website and get statistics for the same. YSlow is really cool, offers good guidelines also. However, i am very confused with so many things around (Though it's good that people already invested time and have made nice g...

Authorization header in Ruby on Rails accessed with key HTTP_AUTHORIZATION instead of Authorization?

I'm hoping someone can clear something up for me. I'm using Rails 2.3.5, and I can access request headers in a controller action like this: def index if request.headers['...'] == '...' ... end end Or something similar. request.headers is an instance of ActionController::Http::Headers which appears to be a Hash. I would expect,...

Is AJAX push a HTTP protocol aberration?

Develop a elegant Pub-Sub architecture in web-oriented-apps is a real challenge. Although there are some very interesting solutions using long-polling-connections (e.g. COMET) and repetitive-timeouts (e.g. js setTimeout). IMHO AJAX push still looking like a layer of tweaks and hacks forcing the innocent HTTP protocol. So what do you thi...

Python: Asynchronous http requests sent in order with automatic handling of cookies?

Hello, I am coding a python (2.6) interface to a web service. I need to communicate via http so that : Cookies are handled automatically, The requests are asynchronous, The order in which the requests are sent is respected (the order in which the responses to these requests are received does not matter). I have tried what could be e...

Unescape a string inside a string

I am working with urllib2, and trying to extract the headers in a printable form from a Response object. Presently I am printing str(response.info()), however what is printed, is itself a Python string (at least to my understanding). (Pdb) p str(response.info()) 'Date: Tue, 23 Feb 2010 03:12:26 GMT\r\nServer: Apache\r\nVary: Accept-Enc...

Need an example showing how to do async HTTP requests.

Im using a web service, so I want to use an async thread for the HTTP authentication request and another thread later to make additional service requests while my main thread runs. Would like to see a good example of how to do this and how to show busy messages somehow in main app. How does the main app know when the thread finished? An...

Ordering of values in HttpServletRequest.getParameterValues()

HttpServletRequest.getParameterValues() returns a String[] containing all values of a given HTTP request parameter. Does anyone know if the order of the values in this array is guaranteed by specification to by the same as the order which those values were passed through in the request? For example, if I have the GET query string x=1&x=...

How to optimize caching of images on a webpage

I have a website that contains pages with many small images. The images are set to cache, with the headers containing: Expires "Thu, 31 Dec 2037 23:55:55 GMT" Cache-Control "public, max-age=315360000" When someone loads a page, however, it seems that we are still forced to send a 304 response for each image--better than sending the w...