Online Multimedia

Cards (107)

  • The primary purpose of a GET request in RESTful APIs is to retrieve data and resources from the server without modifiyng it. Therefore, it does not change the content on the server and doesn't have a request body
  • The purpose of a POST request is to create a new resource on the server. When creating it, there's no existing ID to reference, therefore the POST request doesn't require an identifying ID in the URL. It includes a request body that contains data that is sent to the server for processing
  • POST requests are typically used to create new resources on the server by passing parameters through the request body.
  • PUT requests update an existing resource with the provided data.
  • DELETE requests remove a resource from the server
  • Same-origin policy is a security feature that prevents a web browser from accessing resources on a different domain
  • Access-Control-Allow-Origin is used to specify the origins of resources that can be accessed by the client.
  • Stateless Nature of REST: No state is stored in the client or server. Each request is treated intedependently and has no knowledge of any precious requests. This ensures that HTTP Requests happen in complete isolation
  • The DOM (Document Object Model) is a programming interface that allows developers to manipulate HTML documents. Each element can be accessed and manipulated using JavaScript.
  • The DOM provides a way for programming languages to interact with a web page. By manipulating, scripts can change the documents apprearance and content dynamically
  • The code to ensure the main part of the script is executed when the DOM is ready is: document.addEventListener(“DOMContentLoaded”, function() {});
  • Code to reference a field from the body: const name = document.querySelector(".class-name");
  • Code to add an Eventlistener: constName. addEventListener(<eventType>, functionName);
  • code for an asynchronous request to access the APO: function functionName() {
    const query = input.value;
    fetch(`link?<getAccess>=${query}`)
    .then(response => response.json())
    .then(responseHandler);
  • Code to create a seperate list item and display something: element.forEach(element => {const li = document.createElement('li');
    li.innerHTML = element.something;
    ul.appendChild('li');});
  • Web Components are a set of HTML tags that can be used to create reusable UI elements for web pages. They can be used accross different parts of the app without the need for a specific framework or library
  • Web Components give developers more low-level control over the structure, allowing for a more fine-tuned and optimized performance
  • The virtual DOM is a lightweight, in-memory representation of the actual DOM. It tracks and optimizies the update process to the DOM, making it more responsive and efficient
  • On a component's state or props change in React, the virtual DOM calculates the minimum set of changes that need to be made to the actual DOM
  • React has a large developer community, providing a wealth of resources and support for developers
  • Describe one example for a request header and one for a response header. For each, explain in one sentence what they can be used for in a web application
    Request: Authorization - Requesting authentication credentials to grant access to protected ersources on a web server
    Response: Content-Type - specifies the media type of the resource sent to the client
  • True or false: NodeJS per default uses blocking request handling
    false
  • True or false: Service workers can run in the webbrowser in the background, even though the respective web page is not opened
    True
  • True or false: Progressive web apps can be installed on mobile devices only
    false
  • True or false: Service workers allow to access a website again, although the device is offline
    true
  • True or false: Every PWA needs a manifest
    true
  • Explain what is meant by HTTP is stateless
    No state is stored in the client or server. Each request is treated intedependently and has no knowledge of any precious requests. This ensures that HTTP Requests happen in complete isolation
  • Name a common solution that developers apply to circumvent statelessness
    developers often use techniques such as cookies or sessions to maintain user-specific data across multiple requests
  • Explain the following request verbs with a short sentence
    GET: retrieve data/resources from the server
    HEAD: Identical to GET, but without a response body
    POST: create a new resource on the server
    PUT: Updates an existing resource
    DELETE: Remove a resource from the server
    CONNECT: Establishes a tunnel to the server
    OPTIONS: Requests the server to describe communication options
    TRACE: Loop-back test of the path to the target resource
    PATCH: Apply partial modifications to a resource
  • What is the difference between PUT and PATCH requests?
    PUT is used to update an existing resource entirely, requiring an identifying ID, while PATCH applies partial modifications to a resource.
  • What is the DOM in JavaScript?
    The Document Object Model (DOM) is a programming interface provided by browsers that represents a web page as a tree of objects, mirroring the HTML document structure.
  • How does JavaScript handle event propagation?
    Capturing - event travels down to the target
    Bubbling - event travels back up from the target
  • What is the Virtual DOM in React?

    The Virtual DOM is a lightweight, in-memory representation of the actual DOM, used by React to optimize the update process and make applications more responsive
  • What is WebRTC and its key features?

    WebRTC enables real-time communication directly in web browsers and mobile apps, featuring peer-to-peer communication and data channels
  • How do CDNs improve web performance?
    By delivering content from servers close to the user's location, reducing latency, and enhancing load times
  • Difference between authentication and authorization?
    Authentication is the process of verifying who a user is, while authorization determines what an authenticated user is allowed to do
  • What is an HTTP Status Code?
    They indicate whether a specific HTTP request has been successfully completed. Responses are grouped in five classes: 1xx, 2xx, 3xx, 4xx, 5xx
  • Briefly explain the same-origin policy
    It's a security feature to preven a web page from making requests to a different domain than the one that served the web page
  • What is CORS
    Cross-Origin Resource Sharing allows specific domains to access the resource on the server side, using the Access-Control-Allow-Origin header
  • What are benefits of Web Components?
    Reusability: Web Components provide a way to create reusable UI element that can be used accross different parts of the app
    Low-Level-Control: They give developers more low-level control over the structure and behavior of the elements, allowing for a more fine-tuned and optimized performance