retrofit.dart
retrofit.dart copied to clipboard
Add requestUri support
I try to send parameters like this:
@GET("/users") Future<UsersResponse> getUsers( { @Query("id") List<String>ids);
I wait request like this /v2/users?id=5&id=7,
But got this: /v2/users?id=%5b%5d5&id=%5b%5d7
Description of dio https://developpaper.com/flutter-http-library-dio-2-1-was-officially-released/ says that in such case we must use uri. How to fix this?
currently, the lib doesn't support requestUri
. You have to use dio
invoke this method directly.
I'll use interceptor as workaround. And when is it planned to add?
I am working on other urgent issues right now. I will spend effort on this when I get time.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Is this feature realized, or just closed?
It's closed automatically by the robot.
It needs a lot of refactoring work to implement this feature. I have to do changes almost for every single method in generator package.
It may affect the stability of this package. Considering adding this functionality in a future release. Will let you know when I finished this.
Thanks for quick answer. I'll be wait.
I'm facing with this problem too
@hautvfami temporary solution - make request manually
There's another solution I've found, which is to make use of @Queries() Map<String, dynamic> params
.
And then create the queries map like this:
final params = {
'skills[]': ['1', '2'],
};
and if you don't need the brackets, then simply remove and the result will be skills=1&skills=2