Skip to content

Instantly share code, notes, and snippets.

@autch
Created April 11, 2012 04:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save autch/2356840 to your computer and use it in GitHub Desktop.
Save autch/2356840 to your computer and use it in GitHub Desktop.
Converts HTTP GET request to HTTP POST
<?php
$requests = $_GET;
$url = $requests['URL'];
unset($requests['URL']);
$ch = curl_init();
$options = array(
CURLOPT_URL => $url,
CURLOPT_POST => TRUE,
CURLOPT_POSTFIELDS => $requests
);
curl_setopt_array($ch, $options);
curl_exec($ch);
curl_close($ch);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment