Added PUT and PATCH to requestWithMethod to avoid improperly handling JS...

requestWithMethod does the right thing on a POST with JSON data as per the referenced RFC, however PUT and PATCH still have an issue, they should be part of that RFC as well correct? Anyway, minor fix to make that so.