Created
March 11, 2018 15:08
-
-
Save karinharp/60eebf71dad9f2c8ee244faf4f9e3e53 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
<?php | |
if($argc < 3){ echo "Invalid Args"; exit(-1); } | |
$url = trim($argv[1]); | |
$msg = trim($argv[2]); | |
$context = stream_context_create( | |
array( | |
'http' => array( | |
'method'=> 'POST', | |
'header'=> 'Content-type: application/json; charset=UTF-8', | |
'content' => json_encode( | |
array( | |
'content' => $msg, | |
) | |
) | |
) | |
) | |
); | |
file_get_contents($url, false, $context); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment