function to generate post http request to cloud