Added the sendPostRequest function to simplify code
Added the sendPostRequest function