add HTTP support for PUT and DELETE

Modified version of #312.

Fixes #257.