本文整理汇总了PHP中HTTP_Request::disconnect方法的典型用法代码示例。如果您正苦于以下问题:PHP HTTP_Request::disconnect方法的具体用法?PHP HTTP_Request::disconnect怎么用?PHP HTTP_Request::disconnect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HTTP_Request
的用法示例。
在下文中一共展示了HTTP_Request::disconnect方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
$v = false;
foreach ($_POST as $key => $value) {
if ($key == "DESKTOP_XSITE_PARAMS" || $key == "dojo_preventCache") {
continue;
}
if (!$v) {
$v = true;
$p->setMethod(HTTP_REQUEST_METHOD_POST);
}
$p->addPostData($key, $value);
}
foreach ($_GET as $key => $value) {
if ($key == "DESKTOP_XSITE_PARAMS") {
continue;
}
$p->addQueryString($key, $value);
}
$p->sendRequest();
$type = $p->getResponseHeader("Content-Type");
header("Content-Type: {$type}");
foreach (array("400" => "Bad syntax", "401" => "Unauthorized", "402" => "Not Used (Payment Granted)", "403" => "Forbidden", "404" => "Not Found", "500" => "Internal Error", "501" => "Not Implemented", "502" => "Overloaded", "503" => "Gateway Timeout") as $key => $value) {
if ($p->getResponseCode() == $key) {
header("HTTP/1.0 " . $key . " " . $value);
}
}
$body = $p->getResponseBody();
echo $body;
$p->disconnect();
} else {
internal_error("permission_denied");
}