http

Self-referential URLs

What's the most reliable, generic way to construct a self-referential URL? In other words, I want to generate the http://www.site.com[:port] portion of the URL that the user's browser is hitting. I'm using PHP running under Apache. A few complications: Relying on $_SERVER["HTTP_HOST"] is dangerous, because that seems to come straight ...

how do i modify the first returned header on the fly

i mean the HTTP/1.1 xxx yyyyyyy header i can modify all others with mod_headers but want to be able to return a status 200 for 403 error pages to a particular user-agent that dosn't display the text of my 403 pages {it displays an alternate page} just asking if anyone knows an env-var or header name i can alter in apache.conf to alter...

How to get "Guid" variable from http header in ASP.NET

The following line gives an error (cannot convert type "string" to "System.Guid") userId = Request.QueryString["id"]; is there any solution to pass Guid variable in http header Get? ...

Pure Javascript code for HTTP Basic Authentication?

Where can I find reference code that implements a HTTP Basic Authentication client in pure Javascript, suitable for Ajax? (Yes, I could read the spec and implement it myself, but it's for a side project and I'd rather not spend much time on it.) Extra points for code, or pointers to code, that can be used independent of JS toolkits lik...

Is data sent via HTTP POST when the Server does not exist?

I work for a large-ish advertising company. We've created a very lightweight clone of the PayPal IPN so we can offer CC Processing services for our top advertisers. Like the PP IPN, it's a simple RESTful interface. I deliberately instructed our admin guys to configure the vhost for this web app to only respond to requests on port 443...

Uploading big files over HTTP

I need to upload potentially big (as in, 10's to 100's of megabytes) files from a desktop application to a server. The server code is written in PHP, the desktop application in C++/MFC. I want to be able to resume file uploads when the upload fails halfway through because this software will be used over unreliable connections. What are m...

HTTP POST to external ASPX form causing a HTTP 405 error in some cases

I have a situation where we're aggregating what amounts to marketing data from N number of clients, where a client can host a HTML form using any backend of their choice, each with the action of the form pointing to a path that we're hosting. Each client has a different URL, there's no auth (but there is some simple validation of the da...

How to encode a large number (in an URL)?

Quite often one has to encode an big (e.g. 128 or 160 bits) number in an url. For example many web applications use md5(random()) for UUIDs. If you need to put that value in an URL the common approach is to just encode it as an hexadecimal string. But obviously hex encoding is not a very tight encoding. What other approaches are there...

Are URLs allowed to have a space in them?

Are URIs (specifically HTTP URLs) allowed to have a space in them? If they must be encoded, is '+' just a commonly followed convention, or a legitimate alternative? Thanks! EDIT: Can someone point to an RFC indicating that a URL with a space must be encoded? joe ...

Minimal, Standalone, Distributable, cross platform web server.

I've been writing a fair number of smaller wsgi apps lately and am looking to find a web server that can be distributed, preconfigured to run the specific app. I know there are things like twisted and cherrypy which can serve up wsgi apps, but they seem to be missing a key piece of functionality for me, which is the ability to "pseudost...

Are https URLs encrypted?

Are all URL's encrypted when using SSL(https) encryption? I would like to know because I want all URL data to be hidden when using SSL(https). If SSL gives you total URL encryption then I don't have to worry about hiding confidential information form URLs. ...

DNS HTTP Requests

If I was to send a URL to a DNS server, lets say: "dev.example.com/?username=daniel", what is exactly sent to the DNS server? The whole URL (including any passed parameters) or is it just website section "dev.example.com"? I want to know so that I know what parameters I should be hiding in a URL. The reason I am asking is because I jus...

Can I use NSURLCredentialStorage for HTTP Basic Authentication?

I have a cocoa class set up that I want to use to connect to a RESTful web service I'm building. I have decided to use HTTP Basic Authentication on my PHP backend like so… <?php if (!isset($_SERVER['PHP_AUTH_USER'])) { header('WWW-Authenticate: Basic realm="My Realm"'); header('HTTP/1.0 401 Unauthorized'); //Stuff that users...

When should I use GET or POST method? What's the difference between them?

I think the title is my question. I would like to know what's the difference when using GET or POST method in php. Which one is more secure? What are dis/advantages of each of them? Thanks EDIT: I also found similar question to this one here. ...

HTTP GET and POST

Whats the use of HTTP GET method if POST can handle many of the issues of GET? ...

Upload arbitrary data in HTTP Post in Flex

We currently have a Java applet that generates a lot of data and uploads it to our servers. One of the upload methods we have is to use an HTTP POST to our server, the contents of which are just the raw data (no multipart encoding or anything). I'm looking at implementing a Flex app that does the same thing, but I don't see a way to du...

A replacement for python's httplib?

I have a python client which pushes a great deal of data through the standard library's httlib. Users are complainging that the application is slow. I suspect that this may be partly due to the HTTP client I am using. Could I improve performance by replacing httplib with something else? I've seen that twisted offers a HTTP client. It ...

How can I keep an IE page request alive more than 1 minute?

If you are connected to the Internet directly (and not through a proxy) and requests for a page (get/post) in Internet Explorer 7, the default time-out is 1 minute. If the response from the web server takes more than a minute then you end up getting a "Network error" from IE. How can I increase this timeout in IE? Microsoft has docume...

Maximal URL length

Hello, which is the maximum length of an URL? does it depend on the browser? its max length is specified by a RFC? Thanks. Duplicate of What is the maximum length of an url? ...

How to instruct web browsers NOT to cache pages?

I've got a caching problem with the Internet Explorer 6.0 and I want to instruct the browser not to cache the page he's requesting. Further information: In my page, there's a random token that prevents reloading the site and posting the same information twice or more. If you now bookmark this page, the browser has to be instructed to r...