$postdata .= '&' . urlencode($k) . '=' . urlencode($v); } // This GET value will over write anything set before if (!empty($_GET['token'])) { $postdata .= '&token=' . $_GET['token']; } else { if (!empty($_POST['token'])) { $postdata .= '&token=' . $_POST['token']; } else { if (!empty($_COOKIE['ShareUT'])) { $postdata .= '&token=' . $_COOKIE['ShareUT']; } } } if (!empty($_COOKIE['__stid'])) { $postdata .= '&clicookie=' . $_COOKIE['__stid']; } $ipAddress = !empty($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR']; if (!empty($ipAddress)) { $postdata .= '&ipaddress=' . $ipAddress; } if (!empty($postdata)) { list($output, $info) = AjaxProxy::makePostRequest($url, $postdata); // header("Content-Type: ".$info["content_type"]); header("Content-Type: text/html"); echo $output; } else { header("Content-Type: text/xml"); echo '<?xml version="1.0" encoding="UTF-8"?>'; echo '<response status="POST_FAILED" statusMessage="Missing stuff." />'; }
// echo "Cannot write to file ($filename)"; exit; } fclose($file_handle); } else { if (mkdir($new_dir, 0755, true)) { if (!($file_handle = fopen($new_dir . "/" . $path_parts['filename'], 'a'))) { // echo "Cannot open file ($filename)"; exit; } if (fwrite($file_handle, trim($this->_responseBody)) === FALSE) { // echo "Cannot write to file ($filename)"; exit; } fclose($file_handle); } else { // echo 'Failed to create folders...'; exit; } } } } /** * Here's the actual script part. Comment it out or remove it if you simply want * the class' functionality */ $proxy_url = "http://labnol-proxy-server.appspot.com/"; $proxy_url = "http://g-proxy.appspot.com/"; $proxy = new AjaxProxy('http://api.worldbank.org/'); $proxy->execute(); // $proxy->saveCache();
"@default": [ ], "@embed": true }, "supportedOperations": { "@default": [ ], "@embed": true, "expects": { "@default": null, "@embed": false }, "statusCodes": { "@default": [], "@embed": true } } } '; $document = JsonLD::toString(JsonLD::frame(JsonLD::expand($document, $options), $frame)); $headers['Content-Type'] = 'application/ld+json'; } catch (Exception $e) { $exceptionName = get_class($e); if (false !== ($pos = strrpos(get_class($e), '\\'))) { $exceptionName = substr($exceptionName, $pos + 1); } header('HTTP/1.1 400 ' . $exceptionName); //Bad Request'); print htmlspecialchars($e->getMessage()); die; } }; $proxy = new AjaxProxy(); if ($debug) { $proxy->setResponseModifier($debugExpansion); } elseif ($frame) { $proxy->setResponseModifier($frameApiDocumentation); } $proxy->execute();
<?php $service = basename(__FILE__, "_ws.php"); require_once 'default.inc.php'; exit; //CODE RETAINED FOR HISTRICAL REFERENCE require_once 'config.inc.php'; require_once 'AjaxProxy.php'; $url = 'http://' . API_SERVER . '/postTypePad.php'; $getdata = $_SERVER['QUERY_STRING']; $postdata = file_get_contents('php://input'); if ($getdata) { $url .= "?" . $getdata; } else { $url .= "?" . $postdata; } error_log($url, 0); $result = AjaxProxy::makeGetRequest($url); echo $result;