copy the function to post request