`$isCreate ? 'post' : 'put',`  would be a lot easier to read