定制 shopexpress/request-response 二次开发

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

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

shopexpress/request-response

Composer 安装命令:

composer require shopexpress/request-response

包简介

ShopExpress Request - Response

README 文档

README

Request instantiation

$request = new \ShopExpress\RequestResponse\Request\Request('http://example.com/');

Retrieve single input from the query string

$request->query('test', 0);

Retrieve all query string data

$request->query();

Retrieve single input from request payload

$request->request('test', 0);

Retrieve all request payload data

$request->request();

Request method

$request->getMethod();

Retrieve an input item from the request

The input method retrieves values from entire request payload (including the query string). For the case of GET, HEAD request methods, request body isn't being considered.

$request->input('test', 0);

Determining if an input value is present

If you would like to determine if a value is present on the request and is not empty, you may use the filled method. For the case of GET, HEAD request methods, request body isn't being considered.

$request->filled('test');

Response

Response instantiation

$response = new \ShopExpress\RequestResponse\Response\Response(
    Request $request,
    200, 
    ['Content-Type' => 'text/html; charset=utf-8'], 
    'OK'
);

Set response body

$response->setBody('test');

Retrieve header value

$response->getHeader('Content-Type');

Add or replace header value

If you would like to add header value, pass true in the last argument

$response->withHeader('Access-Control-Allow-Methods', 'PUT', true);
$response->withHeader('Access-Control-Allow-Origin', '*');

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-07-24

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固