定制 phpstandard/raw-request-factory 二次开发

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

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

phpstandard/raw-request-factory

Composer 安装命令:

composer require phpstandard/raw-request-factory

包简介

A library to create a server request that implements PSR-7 ServerRequestInterface from the raw http request string and vice versa according to the RFC2616 Section 5

README 文档

README

A library to create a server request that implements PSR-7 ServerRequestInterface from the raw http request string and vice versa according to the RFC2616 Section 5.

Installation

$ composer require phpstandard/raw-request-factory

Basic Usage

<?php

use Framework\Http\RawRequestFactory;

// Any implementation of the Psr\Http\Message\ServerRequestFactoryInterface
$server_request_factory = new ServerRequestFactory;

// Any implementation of the Psr\Http\Message\StreamFactoryInterface
$stream_factory = new StreamFactory;

// In most cases this will be a server request
// captured from globals (a real http request to the server).
$server_request = $server_request_factory->createServerRequest('POST', 'https://example.com');

$factory = new RawRequestFactory($server_request_factory, $stream_factory);

// Create a raw HTTP request string from the ServerRequestFactoryInterface implementation
$raw_request = $factory->createRawRequest($server_request);

// Create a server request from the raw HTTP request string
$new_server_request = $factory->createServerRequest($raw_request);

Notes

Although RawRequestFactory depends on ServerRequestFactoryInterface and StreamFactoryInterface implementation of these interfaces are out of scope of this library.

This library wont work properly with POST requests with Content-Type: multipart/form-data; boundary=something header

Todo

  • Add unit tests
  • Improve library to work with POST request with Content-Type: multipart/form-data; boundary=something header.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-03-20

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固