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

Change RestRequest.Method type from enum to HttpMethod #2166

Open
alexeyzimarev opened this issue Jan 14, 2024 · 0 comments
Open

Change RestRequest.Method type from enum to HttpMethod #2166

alexeyzimarev opened this issue Jan 14, 2024 · 0 comments

Comments

@alexeyzimarev
Copy link
Member

Currently, the type of RestRequest.Method property is RestSharp.Method. Before making the call, RestSharp converts the enum value to a HttpMethod instance. The enum is not extendable, so it is impossible to use any other method that is not included to the enum. Which leads to issues like #1048 and #2124. Whilst the first issue was obvious to implement, adding more and more enum values for not commonly used method possesses a challenge for maintainability.

It could be a good idea to allow using HttpMethod directly, but there's another challenge of backwards compatibility. Also, RestSharp provides enum values for methods like PATCH (n/a in .NET Framework) and MERGE, COPY and SEARCH, which aren't available in HttpMethod as constants.

I'd be happy to hear any design suggestions that would allow using any custom method without changing RestSharp code.

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

No branches or pull requests

1 participant