English subtitles

← Get - Web Development

Get Embed Code
2 Languages

Showing Revision 4 created 05/24/2016 by Udacity Robot.

  1. Okay. Let's move on and now we're going to
  2. talk about HTTP. If you recall, this was what
  3. we described as the main protocol of the
  4. Web. This is what your browser uses to talk
  5. to the, to Web servers. HTTP stands for
  6. HyperText Transfer Protocol. The request from your browser for
  7. the URL www.example.com/foo, begins with a request line, it'll
  8. look something like this. This is the request line,
  9. now HTTP is a, a very simple text
  10. protocol. So, this text is sent over the Internet
  11. to the server, just like this, it's human readable
  12. too. The request line has three main parts. First
  13. there's the method, next is the path and finally
  14. is the version. The method is what type of
  15. requests are making to the server. The most common
  16. method by far is GET. And this is how
  17. you GET a document from the server. Other popular
  18. methods are GET and POST. There are other ones, but
  19. these are the ones we're going to use in the
  20. class. Next is the path. In this case, it's /foo.
  21. You remember this from the URL. But the path
  22. and URL comes here. This is the actual document we're
  23. requesting from the server. And finally is the version. It's
  24. always http/ and then a version number. Most browsers and
  25. servers these days speak at 1.1, but we'll also
  26. touch on 1.0 a little bit in this class. Because
  27. 1.0 has, you know, a few uses of its
  28. own. Now, you're wondering where the host name is in
  29. this request line? It's not here. All that's here
  30. is the path. We're connected to this host, your browser
  31. connected to this host. Or, if we're playing around
  32. with HTTP, we made the connection. But that's how we
  33. know where we are. So that's, this is used for making
  34. the connection, and the path is used for making the request.
  35. Let's have a quick quiz.
  36. Given the following URL, example.com/foo/logo.png?P=1#tricky, what
  37. is the request line to get this URL using HTTP 1.1?