Front-end: Calling the back-end

Can also use the other HTTP methods:
xhr.open('POST','/api/contacts/99',true);
xhr.setRequestHeader('Content-Type',
                     'application/x-www-form-urlencoded');
xhr.send(url_encoded_contact_details);
xhr.open('HEAD','/api/contacts/all',true);
xhr.send(null);
xhr.open('DELETE','/api/contacts/99',true);
xhr.send(null);

Plays nicely with your Web 2.0 API!