support both PUT and POST