Download the PHP package vaibhavpandeyvpz/dakiya without Composer
On this page you can find all versions of the php package vaibhavpandeyvpz/dakiya. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download vaibhavpandeyvpz/dakiya
More information about vaibhavpandeyvpz/dakiya
Files in vaibhavpandeyvpz/dakiya
Package dakiya
Short Description Tiny HTTP client for exchanging PSR-7 messages, based on PSR-18.
License MIT
Homepage https://github.com/vaibhavpandeyvpz/dakiya
Informations about the package dakiya
Dakiya
Dakiya (
डाकिया) means "Postman" in Hindi
A lightweight, PSR-18 compliant HTTP client for PHP 8.2+ that uses cURL as its transport mechanism. Dakiya provides a simple and efficient way to send HTTP requests using PSR-7 message interfaces.
Features
- ✅ PSR-18 Compliant - Implements the HTTP Client Interface standard
- ✅ PSR-7 Compatible - Works with any PSR-7 message implementation
- ✅ Modern PHP 8.2+ - Leverages latest PHP features and type safety
- ✅ Lightweight - Minimal dependencies, only requires cURL extension
- ✅ Streaming Support - Automatic streaming for large request bodies (>1MB)
- ✅ HTTP/2 Ready - Supports HTTP/1.0, HTTP/1.1, and HTTP/2.0
- ✅ All HTTP Methods - GET, POST, PUT, PATCH, DELETE, HEAD
- ✅ Authentication - Built-in support for URI-based authentication
- ✅ Customizable - Configurable via cURL options
Requirements
- PHP 8.2 or higher
- cURL extension
- A PSR-17 HTTP Factory implementation (for creating requests/responses)
- A PSR-7 HTTP Message implementation
Installation
Install via Composer:
Quick Start
Usage Examples
Basic GET Request
POST Request with JSON Body
POST Request with Form Data
Request with Authentication
Custom cURL Options
Different HTTP Protocol Versions
Error Handling
Large File Upload (Streaming)
For request bodies larger than 1MB, Dakiya automatically uses streaming upload:
API Reference
Client
The main HTTP client class implementing Psr\Http\Client\ClientInterface.
Constructor
$factory- A PSR-17 ResponseFactoryInterface implementation$options- Optional array of cURL options to override defaults
Methods
sendRequest(RequestInterface $request): ResponseInterface
Sends a PSR-7 request and returns a PSR-7 response.
Parameters:
$request- The PSR-7 request to send
Returns:
ResponseInterface- The PSR-7 response
Throws:
NetworkException- If a network error occurs (connection failure, timeout, etc.)
Exceptions
ClientException
Base exception class for all HTTP client exceptions. Implements Psr\Http\Client\ClientExceptionInterface.
NetworkException
Thrown when a network-level error occurs (connection failures, timeouts, DNS errors, SSL errors). Implements Psr\Http\Client\NetworkExceptionInterface.
Methods:
getRequest(): RequestInterface- Returns the request that caused the errorsetRequest(RequestInterface $request): void- Sets the request that caused the error
RequestException
Thrown when a request-level error occurs (invalid request format, missing headers, etc.). Implements Psr\Http\Client\RequestExceptionInterface.
Methods:
getRequest(): RequestInterface- Returns the request that caused the errorsetRequest(RequestInterface $request): void- Sets the request that caused the error
PSR-17 Factory Recommendations
Dakiya requires a PSR-17 factory implementation. We recommend:
- vaibhavpandeyvpz/sandesh - A lightweight PSR-17/PSR-7 implementation
- guzzlehttp/psr7 - Popular PSR-7 implementation with factories
- nyholm/psr7 - Fast PSR-7 implementation
Testing
Run the test suite:
Or with coverage:
License
This project is licensed under the MIT License. See the LICENSE file for details.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Support
For issues, questions, or contributions, please visit the GitHub repository.
All versions of dakiya with dependencies
ext-curl Version *
psr/http-client Version ^1.0
psr/http-factory Version ^1.0
psr/http-message Version ^2.0