132
Remember the rst part of the request URL from
getCustomerInfo()?
The request URL is a relative URL
Wait a second. If there’s a mistake in
the request URL, is the server even
getting our request?
This is a relative URL, and doesn’t include the domain name
of the server that the request should be sent to. So what
domain does the browser send this request to? The browser
will automatically use the same domain that it requested the
pizza.html web page from. So if you entered http://www.
breakneckpizza.com/pizza.html to view the Break Neck order
form, your web browser would turn the relative URL above
into an absolute URL, like this:
lookupCustomer.php
http://www.breakneckpizza.com/lookupCustomer.php
We’ve left off
the “phone” request
parameter to make
this a little shorter.
So the request gets sent to the same server that your browser
downloaded the pizza order form from. Even if the program
to run on the server is ... mis-spelled ... the request will still get
sent by your browser to the right server.
absolute and relative urls
This program could be
a Java servlet, or a
PHP script, or a Ruby
component, or any other
bit of code running on
the the server.
http://www.boardsrus.com/getUpdatesBoardSales.php
/getUpdatesBoardSales.php
This is an absolute URL. It has
a domain name...
...and a path to a program or
le on the server.
This is an relative URL. It has
no domain name...
...and just the pa ...