PHPackages                             jaeger/http - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. jaeger/http

ActiveLibrary[HTTP &amp; Networking](/categories/http)

jaeger/http
===========

HTTP 请求类,修改用于QueryList(http://querylist.cc )

1.3(8y ago)917.3k—0%9[1 issues](https://github.com/jae-jae/Http/issues)2MITPHPPHP &gt;=5.1.0

Since Dec 23Pushed 8y ago1 watchersCompare

[ Source](https://github.com/jae-jae/Http)[ Packagist](https://packagist.org/packages/jaeger/http)[ RSS](/packages/jaeger-http/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (6)Used By (2)

Http
====

[](#http)

HTTP 请求类, 支持 CURL 和 Socket, 默认使用 CURL , 当手动指定seCurl 或者 curl 扩展没有安装时, 会使用 Socket目前支持 get 和 post 两种请求方式 ,修改用于QueryList( )

Install
-------

[](#install)

```
composer require jaeger/http

```

Examples
--------

[](#examples)

```
use QL\Ext\Lib\Http;
```

1. 基本 get 请求:

```
    $http = new Http();         // 实例化对象
    $result =  $http->get('http://weibo.com/at/comment');
```

2. 基本 post 请求:

```
    $http = new Http();         // 实例化对象
    $result = $http->post('http://someurl.com/post-new-article',array('title'=>$title, 'body'=>$body) );
```

3. 模拟登录 ( post 和 get 同时使用, 利用 cookie 存储状态 ) :

```
    $http = new Http();         // 实例化对象
    $http->setCookiepath(substr(md5($username), 0, 10));        // 设置 cookie, 如果是多个用户请求的话
    // 提交 post 数据
    $loginData = $http->post('http://login.sina.com.cn/sso/login.php?client=ssologin.js(v1.3.19)', array('username'=>$username, 'loginPass'=>$password) );
    $result =  $http->get('http://weibo.com/at/comment');

```

4. 利用 initialize 函数设置多个 config 信息

```
    $httpConfig['method']     = 'GET';
    $httpConfig['target']     = 'http://www.somedomain.com/index.html';
    $httpConfig['referrer']   = 'http://www.somedomain.com';
    $httpConfig['user_agent'] = 'My Crawler';
    $httpConfig['timeout']    = '30';
    $httpConfig['params']     = array('var1' => 'testvalue', 'var2' => 'somevalue');

    $http = new Http();
    $http->initialize($httpConfig);
    $http->execute();
    $result = $http->result;
```

5. 复杂的设置:

```
    $http = new Http();
    $http->useCurl(false);      // 不使用 curl
    $http->setMethod('POST');       // 使用 POST method

    // 设置 POST 数据
    $http->addParam('user_name' , 'yourusername');
    $http->addParam('password'  , 'yourpassword');

    // Referrer
    $http->setReferrer('https://yourproject.projectpath.com/login');

    // 开始执行请求
    $http->execute('https://yourproject.projectpath.com/login/authenticate');
    $result = $http->getResult();
```

6. 获取开启了 basic auth 的请求

```
    $http = new Http();

    // Set HTTP basic authentication realms
    $http->setAuth('yourusername', 'yourpassword');

    // 获取某个被保护的应用的 feed
    $http->get('http://www.someblog.com/protected/feed.xml');

    $result = $http->result;
```

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity33

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~193 days

Total

4

Last Release

3211d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/351bb9fcc9e4784597bdeba01667aca7dcf4f56927bb18341d20470fc3295ae6?d=identicon)[jae](/maintainers/jae)

---

Top Contributors

[![jae-jae](https://avatars.githubusercontent.com/u/5620429?v=4)](https://github.com/jae-jae "jae-jae (8 commits)")

### Embed Badge

![Health badge](/badges/jaeger-http/health.svg)

```
[![Health](https://phpackages.com/badges/jaeger-http/health.svg)](https://phpackages.com/packages/jaeger-http)
```

###  Alternatives

[friendsofsymfony/rest-bundle

This Bundle provides various tools to rapidly develop RESTful API's with Symfony

2.8k73.3M317](/packages/friendsofsymfony-rest-bundle)[php-http/discovery

Finds and installs PSR-7, PSR-17, PSR-18 and HTTPlug implementations

1.3k309.5M1.2k](/packages/php-http-discovery)[nyholm/psr7

A fast PHP7 implementation of PSR-7

1.3k235.4M2.4k](/packages/nyholm-psr7)[pusher/pusher-php-server

Library for interacting with the Pusher REST API

1.5k94.8M292](/packages/pusher-pusher-php-server)[spatie/crawler

Crawl all internal links found on a website

2.8k16.3M52](/packages/spatie-crawler)[react/http

Event-driven, streaming HTTP client and server implementation for ReactPHP

78126.4M414](/packages/react-http)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
