echo_api.php 490 B

123456789101112131415161718192021
  1. <?php
  2. require_once("common.inc.php");
  3. try {
  4. $req = OAuthRequest::from_request();
  5. list($consumer, $token) = $test_server->verify_request($req);
  6. // lsit back the non-OAuth params
  7. $total = array();
  8. foreach($req->get_parameters() as $k => $v) {
  9. if (substr($k, 0, 5) == "oauth") continue;
  10. $total[] = urlencode($k) . "=" . urlencode($v);
  11. }
  12. print implode("&", $total);
  13. } catch (OAuthException $e) {
  14. print($e->getMessage() . "\n<hr />\n");
  15. print_r($req);
  16. die();
  17. }
  18. ?>