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


PHP http_class::close方法代碼示例

本文整理匯總了PHP中http_class::close方法的典型用法代碼示例。如果您正苦於以下問題:PHP http_class::close方法的具體用法?PHP http_class::close怎麽用?PHP http_class::close使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在http_class的用法示例。


在下文中一共展示了http_class::close方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: array

 function open_url($type, $params = array())
 {
     $http = new http_class();
     $http->request_method = 'POST';
     $http->user_agent = "cesar-rodas/1.0 | Akismet-Class/" . CLASS_VERSION;
     $http->follow_redirect = 1;
     $http->redirection_limit = 5;
     $http->exclude_address = "";
     $http->protocol_version = "1.1";
     $http->GetRequestArguments($this->get_url($type), $arguments);
     $arguments['PostValues'] = $params;
     $this->err = $http->Open($arguments);
     if ($this->err != "") {
         return false;
     }
     $this->err = $http->SendRequest($arguments);
     if ($this->err != "") {
         return false;
     }
     $this->err = $http->ReadReplyHeaders($gHeaders);
     if ($this->err != "") {
         return false;
     }
     if ($http->response_status != 200) {
         $this->err = "Pages status: " . $http->response_status;
         $http->Close();
         return false;
     }
     $response = '';
     for (;;) {
         $this->error = $http->ReadReplyBody($body, 1000);
         if ($this->error != "" || strlen($body) == 0) {
             break;
         }
         $response .= $body;
     }
     $http->close();
     return $response;
 }
開發者ID:emente,項目名稱:kataii---kata-framework-2.x,代碼行數:39,代碼來源:akismet.php

示例2: http_adv_get

function http_adv_get($qtype, $url, $extra = array(), $headers = array())
{
    $http = new http_class();
    $http->debug = 0;
    $http->html_debug = 0;
    $http->request_method = $qtype;
    $http->GetRequestArguments($url, $args);
    $err = $http->Open($args);
    foreach ($extra as $key => $value) {
        $args[$key] = $value;
    }
    $body = "";
    foreach ($headers as $key => $value) {
        $args['Headers'][$key] = $value;
    }
    if ($err == "") {
        $err = $http->Open($args);
        $err = $http->SendRequest($args);
        $http->ReadReplyHeaders($headers);
        if ($err == "") {
            if ($err == "") {
                for (;;) {
                    $err = $http->ReadReplyBody($acc, 2000);
                    if ($err != "" || $acc == "") {
                        break;
                    }
                    $body .= $acc;
                }
            }
        }
        $http->close();
    }
    return array($headers, $body);
}
開發者ID:hoanglannet,項目名稱:copar,代碼行數:34,代碼來源:dtube.php


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