當前位置: 首頁>>代碼示例>>PHP>>正文


PHP HTTP_Request::disconnect方法代碼示例

本文整理匯總了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");
}
開發者ID:Rudi9719,項目名稱:lucid,代碼行數:31,代碼來源:xsite.php


注:本文中的HTTP_Request::disconnect方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。