Added PUT and PATCH to requestWithMethod to avoid improperly handling JSON