定制 netflex/http 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

netflex/http

最新稳定版本:v6.7.3

Composer 安装命令:

composer require netflex/http

包简介

Netflex HTTP library

README 文档

README

Stable version Build status License: MIT Contributors Downloads

[READ ONLY] Subtree split of the Netflex Http component (see netflex/framework)

This library provides a standalone Http client.

Installation

composer require netflex/http

Usage

<?php

use Netflex\Http\Client;

$client = new Client();

$post = $client->get('https://jsonplaceholder.typicode.com/posts/1');

echo $post->title;

The default for the client is to automatically parse the content based on it's content type.

If the content type is application/json, it will be parsed as an object. If you need the response as a associative array instead, all the http methods on the client takes an optional last boolean argument that enables this.

$post = $client->get('https://jsonplaceholder.typicode.com/posts/1', true);

echo $post['title'];

Laravel service provider and facade

If installed through Laravel, you can use the Facade. The service provider will auto register.

<?php

use Netflex\Http\Facades\Http;

$post = Http::get('https://jsonplaceholder.typicode.com/posts/1');

echo $post->title;

You can optionally use the alias:

<?php

use Http;

$post = Http::get('https://jsonplaceholder.typicode.com/posts/1');

echo $post->title;

统计信息

  • 总下载量: 2.35k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 3
  • 依赖项目数: 3
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-09-08

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固