Skip to content

learn-co-students/receiving-api-posts-lab-v-000

Repository files navigation

Receiving API POSTs Lab

Objectives

  1. Send form via POST request with jQuery.
  2. Create resources from an AJAX POST.
  3. Render and consume JSON responses for created resources.

Introduction

In this lab, we're going to continue to enhance our product and order system, this time updating the product creation page to create and display new products without requiring a refresh or redirect.

The solution for the previous lab has been included for you.

Instructions

  1. Update the new product page to submit the form via AJAX POST.
  2. Update the product create action to render a JSON representation of the product after successfully creating it.
  3. Display the product details of the newly created product on the new page without refreshing or redirecting.
  4. Make sure those tests pass!