2017 © Pedro Peláez
 

library http-server-form-parser

A form parser for Amp's HTTP parser.

image

amphp/http-server-form-parser

A form parser for Amp's HTTP parser.

  • Thursday, May 10, 2018
  • by kelunik
  • Repository
  • 3 Watchers
  • 6 Stars
  • 27 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 50 % Grown

The README.md

http-server-form-parser

This package is an add-on to amphp/http-server, which allows parsing request bodies as forms in either x-www-form-urlencoded or multipart/form-data format., (*1)

Installation

This package can be installed as a Composer dependency., (*2)

composer require amphp/http-server-form-parser

Usage

Basic usage works by calling parseForm($request), which will buffer the request body and parse it., (*3)

<?php

use Amp\Http\Server\FormParser;
use Amp\Http\Server\Request;
use Amp\Http\Server\RequestHandler\CallableRequestHandler;
use Amp\Http\Server\Response;
use Amp\Http\Status;

new CallableRequestHandler(function (Request $request) {
    /** @var FormParser\Form $form */
    $form = yield FormParser\parseForm($request);

    return new Response(Status::OK, [
        "content-type" => "text/plain; charset=utf-8"
    ], $form->getValue("text") ?? "Hello, World!");
});

There's also an advanced streaming parser included, which can be used to stream uploaded files to disk or other locations., (*4)

The Versions

10/05 2018

dev-refactor

dev-refactor https://github.com/amphp/http-server-form-parser

A form parser for Amp's HTTP parser.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Bob Weinand
by Aaron Piotrowski

form http async non-blocking amp amphp

10/05 2018

dev-master

9999999-dev https://github.com/amphp/http-server-form-parser

A form parser for Amp's HTTP parser.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Bob Weinand
by Aaron Piotrowski

form http async non-blocking amp amphp