Basics


Set of flashcards Details

Flashcards 50
Language English
Category Computer Science
Level University
Created / Updated 03.07.2018 / 03.07.2018
Weblink
https://card2brain.ch/box/20180703_webengineering
Embed
<iframe src="https://card2brain.ch/box/20180703_webengineering/embed" width="780" height="150" scrolling="no" frameborder="0"></iframe>

What is the difference between GET and POST?

 

GET requests data from a specified resource. POST submits data to be processed to a specified resource.

Which are the four most common HTTP methods for REST services?

  • - POST (CRUD: create): Create a new resource.
  • - GET (CRUD: read): Read a specific resource (by an identifier) or a collection of resources.
  • - PUT (CRUD: update): Update a specific resource (by an identifier) or a collection of resources.
  • - DELETE (CRUD: delete): Remove/delete a specific resource by an identifier.

What is a web service?

 

A web service is a function that can be accessed by other programs over the web (Http). To clarify a bit, when you create a website in PHP that outputs HTML its target is the browser and by extension the human being reading the page in the browser. A web service is not targeted at humans but rather at other programs.
So, your PHP site that generates a random integer could be a web service if it outputs the integer in a format that may be consumed by another program. It might be in an XML format or another format, as long as other programs can understand the output.

What are REST services?

REST stands for Representational State Transfer and it is based on the hypermedia architecture style. REST constraints are uniform, stateless, cacheable, client-server, layered system. The concept is based on resources, which will be addressed using ID’s. REST uses a limited range of standard methods. Resources are interlinked with other resources and every resource can have different representations. REST is a stateless communication.

 

Der Zweck von REST liegt schwerpunktmäßig auf der Maschine-zu-Maschine-Kommunikation. REST stellt eine einfache Alternative zu ähnlichen Verfahren wie SOAP und WSDL und dem verwandten Verfahren RPC dar. Anders als bei vielen verwandten Architekturen kodiert REST keine Methodeninformation in den URI, da der URI Ort und Namen der Ressource angibt, nicht aber die Funktionalität, die der Web-Dienst zu der Ressource anbietet. Der Vorteil von REST liegt darin, dass im WWW bereits ein Großteil der für REST nötigen Infrastruktur (z. B. Web- und Application-Server, HTTP-fähige Clients, HTML- und XML-Parser, Sicherheitsmechanismen) vorhanden ist, und viele Web-Dienste per se REST-konform sind. Eine Ressource kann dabei über verschiedene Medientypen dargestellt werden, auch Repräsentation der Ressource genannt.

What is JSON and what are the main building blocks of it?

 

JSON is a data-interchange format. It is very lightweight. While it is easy for humans to read and write, it is also easy for machines to parse and generate. It is based on a subset of the JavaScript programming language and it is a text format that is completely language independent. JSON is an ideal data-interchange language.
JSON is built on two structures:
- A collection of name/value pairs (in other languages realized as an object)
- An ordered list of values (in other languages realized as an array)

How can the requester be informed about the data format of the response using HTTP?

Usually, the requester tells the responder which format will be accepted when sending the HTTP request. However, in the response, the header contains the content-type of the data.

 

Client --> URL / Method / Header / Body  --> Server

Server --> Status Code / Header / Body --> Client

How can the requester be informed about the status using HTTP?

There is the HTTP status code which is sent with the reply on the request. E.g. 200 (success), 201 (created), 404 (not found), 401 (unauthorized)

How does API authorization/authentication work?

For the authentication the client is providing its identity to the server. This can be done with the credentials: an API key or an API username and password. This information is sent within the header with a base64 -encoded string: as username:password. The API key is needed for the token authentication. It is a cryptic string (Sendgrid Key). The authorization is managed by the API itself.

What is AJAX and what does it stand for?

AJAX stands for ‘Asynchronous JavaScript and XML. AJAX is not a programming language, AJAX just uses a combination of a browser built-in XMLHttpRequest object (to request data from a web server) and JavaScript and HTML DOM (to display or use the data). AJAX is a misleading name; AJAX applications might use XML to transport data, but it is essentially common to transport data as plain text or JSON element.
AJAX allows web pages to be updated asynchronously by exchanging data with a web server behind the scenes. This means that it is possible to update parts of a web page, without reloading the whole page. Classic web pages, (which do not use AJAX) must reload the entire page if the content should change. Examples of applications using AJAX: Google Maps, Gmail, Youtube, and Facebook tabs.

What is jQuery and what is the benefit of it?

 

jQuery is a lightweight, "write less, do more", JavaScript library.

The purpose of jQuery is to make it much easier to use JavaScript on your website.

jQuery takes a lot of common tasks that require many lines of JavaScript code to accomplish, and wraps them into methods that you can call with a single line of code.

jQuery also simplifies a lot of the complicated things from JavaScript, like AJAX calls and DOM manipulation.

The jQuery library contains the following features:

  • HTML/DOM manipulation
  • CSS manipulation
  • HTML event methods
  • Effects and animations
  • AJAX
  • Utilities

In addition, jQuery has plugins for almost any task out there. The main benefit is that you have to write less code. Furthermore, you can use plugins that accomplish tasks that you would have to code yourself.