webclient/helper-form 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

webclient/helper-form

Composer 安装命令:

composer require webclient/helper-form

包简介

Helper for creating PSR-7 request with files

README 文档

README

Latest Stable Version Total Downloads License PHP

webclient/helper-form

Helper for creating PSR-7 request with files.

Install

Install this package and your favorite psr-17 implementation.

composer require webclient/helper-form:^1.0

Now it’s very easy to create file requests for PSR-18 HTTP Clients!

Using

<?php

use Psr\Http\Message\RequestFactoryInterface;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\StreamFactoryInterface;
use Webclient\Helper\Form\Wizard;

/**
 * @var RequestFactoryInterface $requestFactory
 * @var StreamFactoryInterface $streamFactory
 */
$wizard = new Wizard($requestFactory, $streamFactory);

$fh = fopen('/home/user42/.ssh/id_psa.pub', 'r+');

/** @var RequestInterface $request */
$request = $wizard
    ->createForm('http://localhost:8080/path?query=webclient#fragment', 'POST')
    ->addField('sign_up[login]', 'user42')
    ->addField('sign_up[password]', '$ecr3t')
    ->uploadFromString('about', 'hi!', 'about.txt', 'text/plain; charset=UTF-8')
    ->uploadFromFile('photo', '/home/user42/images/DCIM_4564.JPEG', 'image/jpeg', 'avatar.jpg')
    ->uploadFromResource('public_ssh_key', $fh, 'id_sra.pub', 'text/plain')
    ->createRequest()
;

统计信息

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

GitHub 信息

  • Stars: 4
  • Watchers: 1
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-07-15

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固