/jquery-ajax-get-delete

Primary LanguageJavaScriptOtherNOASSERTION

General Assembly Logo

jQuery AJAX GET & DELETE

Prerequisites

  • HTTP request-response cycle
  • HTTP request structure and URL structure
  • JSON

Objectives

  • Request a collection resource from an API server using both curl and AJAX
  • Request a singular resource from an API server using both curl and AJAX
  • Request a singular resource from an API server using both curl and AJAX
  • Cache data to economize on requests

Preparation

  1. Fork and clone this repository.
  2. Install dependencies with npm install.

Outline

  1. Review URL structure

  2. Review request verbs

  3. Connect to an listr-api on another computer

  4. GET /items

    1. browser
    2. curl
    3. AJAX (when do we want the request to trigger?)
  5. GET /item/:id

    1. browser
    2. curl
    3. AJAX
  6. Display async nature of AJAX requests (echo, console.log)

  7. Change AJAX success to cache returned data

  8. Use cached data DELETE /item/:id

Source code distributed under the MIT license. Text and other assets copyright General Assembly, Inc., all rights reserved.