I decided to write an body
When POSTing an Ajax request, the body might be quite short: just a bit of JSON, say
The point, though, is that for POST, the BODY contains the data, if any.
We can also look in the developer tools. I'll demo that when we get to the demo.
POST creates a new entity. Like SQL INSERT
PUT updates and existing entity. List SQL UPDATE
Quite well. Just nest the structures:
{place: {name: "Wellesley", address: {streetAddr: {name: "College St", number: 106}}}}
Great question! You can certainly POST username/password values using Ajax. Or, you can use sessions.
Ajax requests include cookies, which includes
the session cookie, so you can do everything with Ajax
that we do with non-Ajax.
Let's do it!