What can you do with HTTP?

HTTP is a protocol to transfer hypertext (remember <html>?) on the World Wide Web (WWW). If you have used a web browser to access any website (chances are that you have), then you've already used HTTP. Your web browser works as a client on your system, requesting access to resources, such as web pages or files, over the network. Your web browser uses HTTP to send the request to the server. The requested resources are transferred from the server to the client, using the HTTP protocol.

The most common HTTP operations are GET, POST, PUT, and DELETE. Here are a few quick examples:

  • Imagine registration on a website; you fill in your details and submit them. This is a POST request, in which the form values are not appended to the URI.
  • Now, imagine bookmarking the details page of your favorite book in an online portal (say, https://www.amazon.co.uk/). You'll notice a set of variable names and values appended to the URI (separated by &) following the question mark (?). There's an example at https://www.amazon.co.uk/s/ref=nb_sb_noss?url=search-alias%3Daps&field-keywords=mala+oca+8. This is a GET request.
  • The PUT request is used to create or update an entity on a server, using a URI. The PUT request refers to the entity, whereas a POST request refers to a resource that will handle the submitted data.
  • The DELETE request can delete an entity, using an identifying ID appended to a URI.
Don't worry if you couldn't follow all of the HTTP operations, such as GET, POST, PUT, or DELETE. You'll be able to follow them as you progress with the chapter.

In the same way that you can access resources over the network by using a web browser, you can use your Java code to access the same resources programmatically. There are multiple use cases; for example, imagine connecting to a website, downloading the latest news and simply listing it for the users of your application.

More information on HTTP/2 can be accessed at https://tools.ietf.org/html/rfc7540.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.144.248