当前位置: 首页>>代码示例>>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;未经允许,请勿转载。