avoid an exception when calling put/patch/delete on a get or post request