04.06.2013 Views

Head First HTML with CSS

Head First HTML with CSS

Head First HTML with CSS

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

What is the HTTP Protocol?<br />

HTTP is also known as the HyperText Transfer Protocol. In other words,<br />

it’s an agreed-upon method (a protocol) for transferring hypertext<br />

documents around the Web. While “hypertext documents” are usually<br />

just <strong>HTML</strong> pages, the protocol can also be used to transfer images, or<br />

any other file that a Web page might need.<br />

HTTP is a simple request and response protocol. Here’s how it works:<br />

HTTP response: I found<br />

that file, here it is.<br />

HTTP Request: could I please<br />

have the file /index.html?<br />

www.starbuzzcoffee.com<br />

So each time you type a URL into your browser’s address bar, the<br />

browser asks the server for the corresponding resource using the HTTP<br />

protocol. If the server finds the resource, it returns it to the browser and<br />

the browser displays it. What happens if the server doesn’t find it?<br />

HTTP response: error<br />

#404, I can’t find it.<br />

HTTP Request: could I please have<br />

the file /hardtofind.html?<br />

www.starbuzzcoffee.com<br />

If the resource can’t be found, you’ll get the familiar “404 Error”,<br />

which the server reports back to your browser.<br />

getting connected<br />

Whatever you do,<br />

don’t pronounce URL as<br />

“Earl,” because that’s my<br />

name. It’s pronounced<br />

U-R-L.<br />

you are here 137

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!