Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ExecuteRequestAsync as public #2163

Open
RomanSoloweow opened this issue Jan 6, 2024 · 9 comments
Open

ExecuteRequestAsync as public #2163

RomanSoloweow opened this issue Jan 6, 2024 · 9 comments

Comments

@RomanSoloweow
Copy link
Contributor

Continue discussion #1952
Api was changed, it's nice. But it still difficult to implement generic logic for all requests.
If we check implementation for ExecuteAsync and DownloadStreamAsync methods, they have common part: ExecuteRequestAsync.
Why don't you want to make this method public? This will allow library developers to write more versatile and more enjoyable code.

image

@RomanSoloweow
Copy link
Contributor Author

@alexeyzimarev any news?

@alexeyzimarev
Copy link
Member

I have no issue with that but it would mean the function will become a part of the interface, which will introduce breaking changes for everyone who use the interface.

@RomanSoloweow
Copy link
Contributor Author

Which interface you mean?

@RomanSoloweow
Copy link
Contributor Author

I think it's can be not included in interface. Only as part of RestClient object

@rassilon
Copy link

There is RestRequest.OnAfterRequest for the brave..

@alexeyzimarev
Copy link
Member

@rassilon I think the idea here to enable creating extensions that would use ExecuteRequestAsync. However, it will require exposing the internal HttpResponse type as public. I don't really see a problem doing that.

One option is to make ExecuteRequestAsync the only function in the interface, and convert both ExecuteAsync and DownloadStreamAsync to extensions. It would also allow resolving issues with extending the basic functionality, like returning a tuple for downloads (there's an open issue for that, and a PR).

@rassilon
Copy link

That definitely sounds like a good idea.

@RomanSoloweow
Copy link
Contributor Author

Sounds perfect

@RomanSoloweow
Copy link
Contributor Author

@alexeyzimarev any news?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants