Comments (3)
Well, actualy I just realized that Gt\Fetch\Http implements Http\Client\HttpClient which in turn extends the PSR-18 Psr\Http\Client\ClientInterface already.
But if there was PSR-18 client injected as dependency, it would be really nice, because you can then get rid off all the mess with curl, and have users inject their preferred implementation of psr 18 client and this library can focus on the async part. Making it async http client over any psr 18 client. This seems much more flexible then an async http client that also, along the way, provides unnecesarily complicated implementation of psr 18 client.
So Actualy maybe I vote against having Gt\Fetch\Http implements Psr18 ClientInterface. I vote for it to be injected dependency.
from fetch.
It would certainly be a good thing for those rare occassions where, for instance, cURL is not fully available.
from fetch.
It's been some time since I've added functionality to this repo, but I'm currently working on branch 89-async
to make many improvements, one of which is the change to making @slepic's suggestion: Fetch is now compatible with other Http\Client\HttpClient implementations, but does not try to implement it itself.
Will be released to v2 once I've completed the other compatibility improvements.
Thanks and happy new year!
from fetch.
Related Issues (20)
- Internal errors parsing response are not triggering "catch" functions HOT 2
- Implement "redirect: error" option
- Update Fetch to use new Http release (FormData and file uploads)
- Force "application/x-www-form-urlencoded" to send stringified post body
- Synchronous text, json, arraybuffer, blob functions HOT 1
- BodyResponse promise is not resolving HOT 3
- Difference between blob/text ? HOT 1
- FormData to send data using x-www-form-urlencoded HOT 1
- Json response object improvement
- Json->getStdClass()
- Stress test and concurrency limit
- fetch() and fetchAwait() functions
- Replace Async functionality HOT 3
- Init parameters on the server-side
- Cache modes
- Subresource integrity
- AbortSignal init parameter
- Dependabot
- FormData type
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fetch.