All Projects → fain182 → diciotto

fain182 / diciotto

Licence: MIT License
✈️ A no-nonsense PHP Http client focused on DX (PSR 18 compliant)

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to diciotto

Katipo
HTTP2 client for Erlang based on libcurl and libevent
Stars: ✭ 90 (+291.3%)
Mutual labels:  curl, http-client
Ob Http
make http request within org-mode babel
Stars: ✭ 191 (+730.43%)
Mutual labels:  curl, http-client
H2c
headers 2 curl. Provided a set of HTTP request headers, output the curl command line for generating that set. Try the converter online at
Stars: ✭ 113 (+391.3%)
Mutual labels:  curl, http-client
Curlie
The power of curl, the ease of use of httpie.
Stars: ✭ 877 (+3713.04%)
Mutual labels:  curl, http-client
php-curl-cookbook
PHP CURL Cookbook 📖
Stars: ✭ 83 (+260.87%)
Mutual labels:  curl, http-client
Lush Http
Smart Http Client for PHP
Stars: ✭ 60 (+160.87%)
Mutual labels:  curl, http-client
Curlsharp
CurlSharp - .Net binding and object-oriented wrapper for libcurl.
Stars: ✭ 153 (+565.22%)
Mutual labels:  curl, http-client
Yii2 Httpclient
Yii 2 HTTP client
Stars: ✭ 406 (+1665.22%)
Mutual labels:  curl, http-client
go-axios
HTTP Request package for golang.
Stars: ✭ 29 (+26.09%)
Mutual labels:  curl, http-client
Fetch
Asynchronous HTTP client with promises.
Stars: ✭ 29 (+26.09%)
Mutual labels:  curl, http-client
Urllib
Request HTTP(s) URLs in a complex world
Stars: ✭ 600 (+2508.7%)
Mutual labels:  curl, http-client
curly.hpp
Simple cURL C++17 wrapper
Stars: ✭ 48 (+108.7%)
Mutual labels:  curl, http-client
Guzzle
Guzzle, an extensible PHP HTTP client
Stars: ✭ 21,384 (+92873.91%)
Mutual labels:  curl, http-client
Http Client
A high-performance, high-stability, cross-platform HTTP client.
Stars: ✭ 86 (+273.91%)
Mutual labels:  curl, http-client
Node Libcurl
libcurl bindings for Node.js
Stars: ✭ 447 (+1843.48%)
Mutual labels:  curl, http-client
Httpp
Micro http server and client written in C++
Stars: ✭ 144 (+526.09%)
Mutual labels:  curl, http-client
Kurly
kurly is an alternative to the widely popular curl program, written in Golang.
Stars: ✭ 319 (+1286.96%)
Mutual labels:  curl, http-client
Requests
Requests for PHP is a humble HTTP request library. It simplifies how you interact with other sites and takes away all your worries.
Stars: ✭ 3,433 (+14826.09%)
Mutual labels:  curl, http-client
Httpie
As easy as /aitch-tee-tee-pie/ 🥧 Modern, user-friendly command-line HTTP client for the API era. JSON support, colors, sessions, downloads, plugins & more. https://twitter.com/httpie
Stars: ✭ 53,052 (+230560.87%)
Mutual labels:  curl, http-client
1c http
Подсистема 1С для работы с HTTP
Stars: ✭ 48 (+108.7%)
Mutual labels:  curl, http-client

Imgur

Latest Stable Version Build Status Coverage Status

Diciotto is a no-nonsense PSR-18 compliant HTTP client library for PHP 7.

Principles

  • Documentation should be unnecessary
  • Provide sensible defaults
  • Explicit is better than implicit
  • Prefer a good Developer eXperience over performance
  • No surprises

Install

    composer require fain182/diciotto

How to...

make a GET request

    $httpClient = new HttpClient();
    $response = $httpClient->sendRequest( new Request('http://www.google.com') );

make a POST request with body in JSON

    $httpClient = new HttpClient();
    $request = new JsonRequest('https://httpbin.org/put', 'POST', ['name' => 'value']);
    $response = $httpClient->sendRequest($request);

make a request with a different timeout

The default timeout is 15 seconds.

    $httpClient = (new HttpClient())->withTimeout(30);
    $response = $httpClient->sendRequest( new Request('http://www.google.com') );

make a request to a server with self-signed or invalid SSL certificate

    $httpClient = (new HttpClient())->withCheckSslCertificates(false);
    $response = $httpClient->sendRequest( new Request('http://www.google.com') );

make a request with a cookie

    $httpClient = new HttpClient();
    $request = (new Request('http://www.google.com'))->withAddedCookie('name', 'value');
    $response = $httpClient->sendRequest( $request );

Error handling

Diciotto raise exception if the request is invalid (RequestException), or if there are network problems (NetworkException). Response with status code 4xx or 5xx are treated the same way as the others, so no exception or error is raised.

About

Requirements

  • Diciotto works with PHP 7.1 or above.

License

Diciotto is licensed under the MIT License - see the LICENSE file for details

Acknowledgements

Diciotto is built on top of nyholm/psr7 that provides PSR-7 and PSR-17 implementation.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].