Make HTTP requests using curl
and AJAX for:
- Altering a specific resource.
Set up the client:
- Fork and clone this repository.
- Create and checkout a new branch (training).
- Install dependencies with
npm install
.
We'll make requests of and receive responses from an HTTP server we'll set up together:
- Open a new terminal (window or tab).
- Change into
~/wdi/tmp/library-api
. - Run the HTTP server with
rails server
.
We're now ready to make requests.
I'll use curl to alter a single book.
We'll use curl to alter a single book. Code along as I alter a script to my scripts/books/book-patch.sh
file and run it in my terminal.
Now write your own curl script in scripts/books/book-patch.sh
. Alter a few books.
We will use the same markup we wrote in the jquery-ajax
lessons, if you
do not have working code ask your neighbor to slack you theirs.
We'll be going back and forth between watching me and doing it yourself.
- All content is licensed under a CCBYNCSA 4.0 license.
- All software code is licensed under GNU GPLv3. For commercial use or alternative licensing, please contact legal@ga.co.