Comments (3)
Thank you ! Will add it to the repo ! :)
from http_extensions.
After looking a little bit into it, what is your use case ?
The only advantage over using directly resolve
on the sent URI to me would be query parameters in global options that would be sent with every request. But that's enough for making an extension. :)
var response = await client.getWithOptions('my-url-string',
options: [RequestOptions(queryParameters: {'option1': 'value1'}]);
Seems more complex than :
var response = await client.get(
Uri.parse('my-url-string').replace(queryParameters: {'option1': 'value1'}));
But for this use case it may be useful :
final client = ExtendedClient(
inner: Client(),
extensions: [
QueryExtension(
defaultOptions: QueryOptions(queryParameters: {'option1': 'value1'}),
),
],
);
var response = await client.get('my-url-string'); // => "my-url-string?option1=value1"
But this usecase is a bad web-api design IMO, recurrent parameters should be passed in headers instead (which gives me a new extension idea :) )
from http_extensions.
I think I was just trying to abstract away some of the Uri code somewhere else. But I agree, it is simpler to just use Uri code in the method. :)
from http_extensions.
Related Issues (5)
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 http_extensions.