Download the PHP package juanchosl/httpdata without Composer
On this page you can find all versions of the php package juanchosl/httpdata. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package httpdata
HttpData
Description
This library implements the definitions of the different elements involved in data transmissions such as HTTP, applying the interfaces defineds in PSRS 7 and 17, adding the extra objects used and ensuring compliance with the requirements that allow to give the necessary stability to our application, being able to implement for third -party bookstores without the need to adapt our business logic to a new implementation that could modify its consumption or internal structure.
Install
Contents
Includes the needed implementations for a data transmission. You can view his definitions for each required block on the official page
PSR-7 Messages
The Containers folder/namespace, implementation of elements included into PSR-7
- Message base class
- Request (extends Message, Client side)
- ServerRequest (extends Request, Server side)
- Response (extends Message)
- Streams
- Uris
- Uploaded files
PSR-17 Factories
The Factories folder/namespace, defines how create the objects, ensuring the full compatibility between libraries, applying the PSR-17
- Server request
- Client request
- Response
- Streams
- Uris
- Uploaded files
Server factory
As an extra, we can create a full formatted Server request, ir order to retrieve a standard object from
- using the fromGlobals method and adquire data from _SERVER superglobal constant without pass any parameter
- using the fromRequest method, using a pre created Request as parameter, usefull for tests and console actions
FIG Message utils
The library includes the messages utils from FIGs of PHP, includes the
RequestMethodsInterface
Constants for the distincts http available methods
- GET
- POST
- PUT
- PATCH
- DELETE
- HEAD
- OPTIONS
- PURGE
- TRACE
- CONNECT
StatusCodesInterface
All the standard status codes, for use across your system
Body String creators
In order to create standard sender bodies, are providing 2 tools in order to create multipart/form-data and application/x-www-form-urlencoded
URL Encoder
Available for GET or BODY params, creating an urlencoded string from any array type
Multipart Encoder
Available for BODY params, creating multipar/form-data srting from any array type
Can add files from 3 distincts formats too
Body String reverse parsing
In order to receive standard bodies and parse to use it, you can read and convert the multipart/form-data and application/x-www-form-urlencoded string body contents
Multipart decoder
Available for BODY contents, reading multipar/form-data srting to array type
Can extract files too
We can extract both value groups, as array, with data into index 0 and files into index 1
Or populate to globals directly in order to use it for PATCH and PUT requests
All versions of httpdata with dependencies
ext-mbstring Version *
fig/http-message-util Version 1.1.*
psr/http-message Version ^2.0
psr/http-factory Version 1.1.*
psr/http-client Version 1.0.*
juanchosl/exceptions Version 1.0.*
juanchosl/httpheaders Version 1.0.*