Server Flashcards
Server
Is a generic term referring to either software or hardware that processes request from clients. A server offers shared resources that can be requested for use by a client.
Client
Is software that sends a request to a server to access a shared resource and processes the response returned from the server.
http://www.techelevator.com:80/events/current?month=march&day=27#00h02m30s
http:// Protocol
www.techelevator.com Domain
:80 Port
/events/current Path to resource
? Query
month=march&day=27 Parameters
#00h02m30s Anchor/Fragment
Domain names
Are composed of parts, each separated by a period. Domains start a top-level domain and then form a hierarchy of subdomains, each a child of the higher-level domain.
dashboard.techelevator.com
.com is the top-level domain
.techelevator is a subdomain of .com
dashboard. is a subdomain of .techelevator.
IP (Internet Protocol) Address
Identifies a computer or device on a network (including the internet). All devices/computers on a network must have an IP address to communicate with other devices/computers on the network. It gives the location of the device like the street address of a house.
Types of IP Address
IPv4 - dotted-decimal notation
IPv6 - in hexadecimal
DNS (Domain Name System)
Allows for easy-to-remember names for IP address. Like a map with string keys (techelevator.com) and IP address values (198.49.23.144)
Port
Used to identify which server application should handle the request. Port 80 - HTTP Port 443 - HTTPS Port 25 - SMTP (Email Mail) Port 21 - FTP (File Transfer) Port 22 - SSH (Secure remote terminal)
HTTP (HyperText Transfer Protocol)
It is a defined language and process they will use when the client makes a request and the server returns a response.
Parts of an HTTP Request
- Method.
- Requested Resource.
- Header.
- Parameters.
Parts of an HTTP Response
- Status Code.
- Header.
- Content-Type.
- Content (Body).
Method (VERB) parts of an HTTP Request
GET - Retrieves information
POST - Adds information
PUT - Updates information
DELETE - Deletes information
Method (VERB) part of an HTTP Request
GET - Retrieves information
POST - Adds information
PUT - Updates information
DELETE - Deletes information
Requested Resource part of an HTTP Request
A resource is something shared by the client. It can be an HTML page, CSS, a file like an image or pdf document, information from a database, access to a stream, or anything else the server can deliver.
Header part of an HTTP Request
The header contains details about the request, such as the browser, IP address, preferred language, etc.
Parameters part of an HTTP Request
Parameters include data to be used to fulfill the request. Similar to arguments sent to a Java method.
Status Code part of an HTTP Response
1xx - Informational
2xx - Success: 200 - OK, 201 - Created
3xx - Redirected: 301 - Moved Permanently
4xx - Client Error: 400 - Bad Request, 401 - Unauthorized, 403 - Forbidden, 404 - Resource Not Found
5xx - Server Error: 500 - Server Exception
Header part of an HTTP Response
Meta Information about the response.
Content-Type
The type of content being returned: text, JSON, image, stream, etc.
Content (Body)
The output of the response. HTML, image, data, etc.
API Application Programming Interface
Is a way for software components to talk to each other. The methods and properties in our classes that are exposed as the public are the API of the object.
Web Service (Web API)
A Web Service or Web API is an API that allows for applications to communicate with each other across the internet. All Web Services are APIs, however, not all APIs are Web Services.
REST (REpresentational State Transfer)
Is a software architectural pattern that defines a set of constraints and standards for how 2 applications on a network should communicate.
Rules of REST:
- Uniform Interface (URI, URL).
- Stateless.
- Cacheable.
- Client-Server.
- Layered System.
REST Uniform Interface (URI, URL)
The uniform interface constraint defines the interface between clients and servers. It simplifies and decouples the architecture, which enables each part to evolve independently.
REST Stateless
The necessary state to handle the request is contained within the request itself
REST Cacheable
As on the World Wide Web, clients can cache responses.
REST Client-Server
Clients are not concerned with data storage, which remains internal to each server so that the portability of client code is improved. Servers are not concerned with the user interface or user state so that servers can be simpler and more scalable.
REST Layered System
Layers may also enforce security policies.
REST Web Service (Web API)
Web Services that implement the REST standard are said to be RESTful. Commonly use JSON as a response.
JSON (JavaScript Object Notation)
Is a messaging format that is commonly used by RESTful Web Services.
Uses key/value pairs to represent objects.
Objects are identified by { }, Arrays by [ ]
Objects have properties and values separated by a colon. The property names are Strings in double-quotes. The value can be a number, String (with double quotes), Array, or Object.
Each property/value pair, object, or array is separated by a comma.