Download the PHP package vaibhavpandeyvpz/sandesh without Composer
On this page you can find all versions of the php package vaibhavpandeyvpz/sandesh. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download vaibhavpandeyvpz/sandesh
More information about vaibhavpandeyvpz/sandesh
Files in vaibhavpandeyvpz/sandesh
Package sandesh
Short Description PSR-7 and PSR-17 implementation, works with PHP >= 8.2.
License MIT
Homepage https://github.com/vaibhavpandeyvpz/sandesh
Informations about the package sandesh
Sandesh
A modern, PHP 8.2+ implementation of PSR-7 (HTTP Message Interfaces) and PSR-17 (HTTP Factories). Sandesh (संदेश) means "message" in Hindi.
Features
- ✅ Full PSR-7 and PSR-17 compliance
- ✅ PHP 8.2+ with strict types and modern features
- ✅ Immutable message objects
- ✅ Type-safe HTTP method enum
- ✅ Cookie parsing and management (RFC 6265)
- ✅ Server response sender
- ✅ Automatic body parsing (JSON, form data, XML)
- ✅ Comprehensive test coverage
Installation
Requirements
- PHP >= 8.2
- PSR-7 HTTP Message Interfaces (^2.0)
- PSR-17 HTTP Factory Interfaces (^1.1)
Quick Start
Creating HTTP Messages
Request
Server Request
Response
Working with URIs
Working with Streams
Working with Uploaded Files
Working with Cookies
Sending Responses
Working with HTTP Methods
Advanced Usage
Immutable Message Pattern
All message objects are immutable. Methods like withHeader(), withBody(), etc., return new instances:
Automatic Body Parsing
Server requests automatically parse common content types:
Request Attributes
Server requests support custom attributes for middleware and routing:
API Reference
Core Classes
Request- HTTP request messageResponse- HTTP response messageServerRequest- Server-side HTTP request with parsed dataUri- URI implementationStream- Stream implementationUploadedFile- Uploaded file implementationCookie- Cookie implementation (RFC 6265)HttpMethod- Type-safe HTTP method enum
Factory Classes
RequestFactory- Creates request instancesResponseFactory- Creates response instancesServerRequestFactory- Creates server request instancesUriFactory- Creates URI instancesStreamFactory- Creates stream instancesUploadedFileFactory- Creates uploaded file instancesCookieFactory- Creates cookie instances from headers
Utilities
ServerResponseSender- Sends HTTP responses to the client
Testing
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Author
Vaibhav Pandey
- Email: [email protected]
- GitHub: @vaibhavpandeyvpz