
          console.log('PUT:', data);
          resultDiv.textContent = 'PUT: ' + JSON.stringify(data);
        })
        .catch(error => {
          console.error('PUT Error:', error);
          resultDiv.textContent = 'PUT Error: ' + error;
        });
    });

    document.getElementById('patch').addEventListener('click', () => {
      http.patch('https://api.camijs.com/posts/1', { title: 'foo updated' }).toJson()
        .then(data => {
          console.log('PATCH:', data);
          resultDiv.textCon