Download the PHP package caijw/http without Composer

On this page you can find all versions of the php package caijw/http. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package http

用来处理http请求

安装

composer require caijw/http

使用

$client = new \Caijw\HttpClient\Client();
$message = $client->post($url, ['k1' => 'v1', 'k2'=> 'v2']);//使用post提交到某个url上
if ($message === false) {
  $exception = $client->getLastException();//异常
}

类方法

/**
 * @param string $url
 * @param array $data
 * @return false|string 如果成功返回字符串,失败返回false,所以要用===来判断
 * @throws SystemException
 */
public function get($url, array $data = array());
public function post($url, array $data = array());

特殊情况

默认情况下,连接超时时间为0.4秒,总体请求超时时间为1秒,如果有必要可以通过setOption调整。
一般情况不用处理返回的Response,如果真的需要,可以使用$this->getLastResponse来获取。如果出现异常,则调用$ex->getResponse()来获取。
当请求出现问题的时候会在/tmp/目录下生成一个以SE-域名为名字开头的临时文件,当问题消失时文件会被删除(用做监控)

钉钉消息

/**
* $robotCode是机器人码,不是url
* $at 可以传三个值
*   true  : @所有人
*   被@人的手机号列表
*   false : 不@人
*/
$ding = new \Caijw\HttpClient\Ding($robotCode,$at);
$ding->text('content');

类方法

/**
 * @method bool text(string $content)
 * @method bool link(string $title, string $text, string $messageUrl, string $picUrl)
 * @method bool markdown(string $title, string $text)
 */

All versions of http with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6
guzzlehttp/guzzle Version ^6.3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package caijw/http contains the following files

Loading the files please wait ....