create $http post req function