antonio-nicolau / clientao Goto Github PK
View Code? Open in Web Editor NEWClientAO is an open-source cross-platform API Client for building and using APIs, visually inspect responses.
ClientAO is an open-source cross-platform API Client for building and using APIs, visually inspect responses.
Is your feature request related to a problem? Please describe.
While the current code may work well for the simple application that makes only a few HTTP calls, more it may become difficult to maintain and scale as the complexity of the application increases.
Describe the solution you'd like
I intend to add a MAP data structure to store the functions corresponding to each HTTP method, this allows you to add support for new HTTP methods without changing existing code, just add a new entry to Map.
final methodHandlers = <HttpVerb, Future<Response>>{
HttpVerb.get: _httpClient.get(uri!, headers: headers),
HttpVerb.post: _httpClient.post(uri!, headers: headers, body: body),
HttpVerb.put: _httpClient.put(uri!, headers: headers, body: body),
HttpVerb.patch: _httpClient.patch(uri!, headers: headers, body: body),
HttpVerb.delete: _httpClient.delete(uri!, headers: headers, body: body),
};
Describe alternatives you've considered
I have considered in the future using function or methods for each method, making the code reusable for more complex functions, you may consider creating an abstract interface or class that defines a common set of methods or properties that can be implemented or extended by specific classes.
example:
abstract class HttpClient {
Future<Response> get(Uri url, {Map<String, String>? headers});
}
class RequestHttpClient implements HttpClient {
@override
Future<Response> get(Uri url, {Map<String, String>? headers}) async {
return get(url.toString(), options: Options(headers: headers));
}
}
This implementation can make the code more scalable and reusable for more complex functions in the future.
Is your feature request related to a problem? Please describe.
The HEAD method is similar to GET, but is generally faster, because the server needs to send only the headers and not the body of the response, so we can consider its implementation necessary.
Describe the solution you'd like
I intend to add the HEAD method is useful when a client needs to check if a resource exists, if it is accessible, and if the server is available.
For example, a HEAD request before downloading a complete resource, to check if the resource is available and if the user has permission to access it. And many other cases that are also relevant to your implementation.
Hi there ๐ we're super happy to know that you're using ClientAO! Please feel free to fill the form below and let us know what bug you're facing
Describe the bug
The branch name of the main repository is "main" and the Contribution documentation mentions fork on "master".
I suggest a correction in the name in which the main repository points.
I suggest that the project has a branch develop
, to have more control of the changes, project mentions the use of gitflow.
All changes first go to branch develop
where they can be analyzed and tested.
When it was to make a release
of a version you could also use gitflow we would have separate branches of the releases
that were already made including the tags that will be generated
ex: release/1.0.0 -> tag v1.0.0
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.