Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
//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
You can’t perform that action at this time.