public static function post($url, $payload, $contentType = 'Content-Type: application/json') {
		// TODO move constants to global configuration file
		$ch = curl_init ( $url );
		curl_setopt ( $ch, CURLOPT_CUSTOMREQUEST, "POST" );
		curl_setopt ( $ch, CURLOPT_POSTFIELDS, $payload );
		curl_setopt ( $ch, CURLOPT_RETURNTRANSFER, true );
		curl_setopt ( $ch, CURLOPT_HTTPHEADER, array (
				$contentType,
				'Content-Length: ' . strlen ( $payload ) 
		) );
		$result = curl_exec ( $ch );
		return $result;
	}
public static function post($url, $payload, $contentType = 'Content-Type: application/json') {
		// TODO move constants to global configuration file
		$ch = curl_init ( $url );
		curl_setopt ( $ch, CURLOPT_CUSTOMREQUEST, "POST" );
		curl_setopt ( $ch, CURLOPT_POSTFIELDS, $payload );
		curl_setopt ( $ch, CURLOPT_RETURNTRANSFER, true );
		curl_setopt ( $ch, CURLOPT_HTTPHEADER, array (
				$contentType,
				'Content-Length: ' . strlen ( $payload ) 
		) );
		$result = curl_exec ( $ch );
		return $result;
	}
public static function post ( $ url , $ payload , $ contentType = 'Content-Type: application/json' ) { // TODO move constants to global configuration file $ ch = curl_init ( $ url ) ; curl_setopt ( $ ch , CURLOPT_CUSTOMREQUEST , "POST" ) ; curl_setopt ( $ ch , CURLOPT_POSTFIELDS , $ payload ) ; curl_setopt ( $ ch , CURLOPT_RETURNTRANSFER , true ) ; curl_setopt ( $ ch , CURLOPT_HTTPHEADER , array ( $ contentType , 'Content-Length: ' . strlen ( $ payload ) ) ) ; $ result = curl_exec ( $ ch ) ; return $ result ; }
Function to post a payload to a url using cURL.

@param string $url
@param string $payload
@param string $contentType
@return mixed the result of the curl execution.
Function to post a payload to a url using cURL .