The protocol is not part of the HTTP spec and is definitely not part of the URI.
Here’s a link to the spec if you have any questions:
Click here
Here are the entire contents for the following url request “http://somehost/foo/bar”.
GET /foo/bar HTTP/1.1
Host: somehost
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.1) Gecko/20060111 Firefox/1.5.0.1
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
As you’ll see “http://” is nowhere to be seen. You can try to “guess” at the protocol by looking at the connecting port (80 for HTTP and 443 for HTTPS) but this can be overridden with your webserver if the webadmin so desires.
If I would try to change the URI to prepend it with “http://” it the resulting post to the server would look like this:
GET http:///foo/bar HTTP/1.1
Host: somehost
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.1) Gecko/20060111 Firefox/1.5.0.1
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
And the webserver will think the request was for “http://somehosthttp://foo/bar” which I guarantee is not what you want.
-Joe