Last active
October 9, 2024 15:27
-
-
Save garsaud/57b112a788535f6b24f4219961d52c42 to your computer and use it in GitHub Desktop.
POST request with file_get_contents()
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
<?php | |
file_get_contents( | |
'https://blah.com/toto.php?something=whatever', | |
false, | |
stream_context_create(['http' => [ | |
'method' => 'POST', | |
'header' => 'Content-type: application/x-www-form-urlencoded', | |
'content' => http_build_query(['hello' => 'goodbye']), | |
] | |
])); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment