Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Kotlin Programming By Example

You're reading from   Kotlin Programming By Example Build real-world Android and web applications the Kotlin way

Arrow left icon
Product type Paperback
Published in Mar 2018
Publisher Packt
ISBN-13 9781788474542
Length 500 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Iyanu Adelekan Iyanu Adelekan
Author Profile Icon Iyanu Adelekan
Iyanu Adelekan
Arrow right icon
View More author details
Toc

Table of Contents (12) Chapters Close

Preface 1. The Fundamentals 2. Building an Android Application – Tetris FREE CHAPTER 3. Implementing Tetris Logic and Functionality 4. Designing and Implementing the Messenger Backend with Spring Boot 2.0 5. Building the Messenger Android App – Part I 6. Building the Messenger Android App – Part II 7. Storing Information in a Database 8. Securing and Deploying an Android App 9. Creating the Place Reviewer Backend with Spring 10. Implementing the Place Reviewer Frontend 11. Other Books You May Enjoy

Fundamentals of the web

Most applications communicate with a server in one way or another. It is imperative that you understand a number of concepts related to the web before continuing in this book. This section explains those concepts concisely.

What is the web?

The web is a complex system of interconnected systems possessing the ability to communicate with other systems existing on a common network via one or more protocols. A protocol is an official, well-defined system of rules governing the exchange of information between devices.

Hypertext Transfer Protocol

All communications over the web are made in accordance with a protocol. A particularly important protocol for fostering communication between systems is the Hypertext Transfer Protocol (HTTP).

Billions of images, videos, text files, documents, and other files are transferred across the internet on a daily basis. These files are all transferred through HTTP. HTTP is an application protocol for distributed and hypermedia information systems. It can be said to be a foundational component for communication across the internet. A major benefit of using HTTP for data transfer across systems is that it is highly reliable. This is as a result of its utilization of reliable protocols, such as the Transmission Control Protocol (TCP) and Internet Protocol (IP).

Clients and servers

A web client is any application that communicates with a web server utilizing HTTP. A web server is a computer that provides – or serves – web resources to web clients. A web resource is anything that provides web content. A web resource can be a media file, an HTML document, a gateway, and so on. Clients need web content for various purposes, such as information rendering and data manipulation.

Clients and servers communicate with each other via HTTP. One major reason for the utilization of HTTP is the fact that it is extremely reliable in data transmission. The use of HTTP ensures data loss does not occur in a request-response cycle.

HTTP requests and responses

An HTTP request – as the name replies – is a solicitation for a web resource sent by a web client to a server over HTTP. An HTTP response is a reply – sent by a server – to a request in an HTTP transaction:

HTTP methods

HTTP supports a number of request methods. These methods can also be referred to as commands. HTTP methods specify the type of action to be performed by the server. Some common HTTP methods are tabularized as follows:

HTTP method Description

GET

Retrieves a named resource present on the client.

POST

Sends data from a client to a server.

DELETE

Deletes a named resource residing on a server.

PUT

Store data collected by the client in a named resource residing on the server.

OPTIONS

Returns HTTP methods that the server supports.

HEAD

Retrieves HTTP headers with no content.

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image