Created
July 4, 2018 21:03
-
-
Save lynt-smitka/b08dab219ea6fdc898f7e5b4e4ce516f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Microsoft Flow endpoint URL | |
$url='https://prod-44.westeurope.logic.azure.com:443/workflows/...'; | |
//Data | |
$data = array( | |
'jmeno' => 'jmeno', | |
'email' => 'e-mail', | |
'text' => 'TEST' | |
); | |
$data_json = json_encode($data); | |
/* cURL Example */ | |
$ch = curl_init($url); | |
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); | |
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_json); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); | |
curl_setopt($ch, CURLOPT_HTTPHEADER, array( | |
'Content-Type: application/json', | |
'Content-Length: ' . strlen($data_json)) | |
); | |
$result = curl_exec($ch); | |
/* file_get_contents() Example */ | |
$options = array( | |
'http' => array( | |
'method' => 'POST', | |
'content' => $data_json, | |
'header'=> "Content-Type: application/json\r\n" . | |
"Accept: application/json\r\n" | |
) | |
); | |
$context = stream_context_create( $options ); | |
$result = file_get_contents( $url, false, $context ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment