-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
[RFC] v109 #1976
Comments
Sounds good. I have tested the prelease and it works good for me. Thank you for your great work |
The |
The only property not including in the interface is
If this method will not be accessable in future it is bad for me but solveable. Another part I want to discuss is the IDisposable on IRestClient. I know it it really common to use IDispoable on interface level because it makes a lot of things easier. But the main purpose to inherit IDispoable is to release (unmanaged) resources. An interface self not contains any resources. But I can understand the descicion to use it on interface level ot make a lot of things easier. The last point: Is it necessary that I can inherit RestClient? Currently there are no members to override. I think it could be I am really looking forward to the next release 👍 The changes are great and I hope the people who hates the v108 will be happy to see the interface again and the new cleaned up configuration pattern |
I am not saying it won't be there. The code you pasted shows how many private functions it uses, not just properties. I am not sure how people use it. For example, I have nothing against bringing it to the interface. The only issue is that for any composition-based implementation (think Polly-based retry client), the implementation of Considering the diagnostics need, there's an issue to add an That's why I am interested in using particular public functions, as they might be used for the needs of alternative solutions. |
Any chance of adding support for request-based cookies as per #1792? |
It's already there in v109 preview |
Oh, OK, sorry! I'll see if I can check it out today - thanks @alexeyzimarev :) |
Hello, I'm not sure if I should comment here or open a separate issue, but we noticed an issue with cookies in the v109 preview. Essentially, the problem we have is that we use RestSharp to talk to a third party API that we don't control and that API sends us invalid cookies. They look something like this: Now, this used to work in v108, but in v109 it throws an error because the
Which leaves us between a rock and a hard place. We can't actually get the third party to fix their cookie headers, and it appears there is currently no way to disable response cookie parsing in v109 of RestSharp. We don't actually care about the cookies at all, just the request body, so would it be possible to have a flag of some sort to disable cookie parsing so that an invaild cookie doesn't kill the request? |
I think it can be fixed. Will check before the new year. |
Do you have an expected / planned ETA for v109? |
I want to include the client factory in the new major, but I haven't figured it out yet. |
Is there anything I can help with, or is it one of those things you just need to hammer away at until it looks right? ;) |
Here's the discussion. The easiest would be to do the same as Flurl does (use base URL as the cached instances key), but they neither do any lifecycle management nor handle cases when the HttpClient is (should be) configured differently even if the base URL is the same. I would prefer using |
It's, basically, figuring out what to do rather than how. The how is relatively easy. |
I'll take a look at the thread in detail and see what the priorities of the client I'm doing the work for is - I'll let you know if I can help soon. |
What's the outlook of the 109 release ? We'd really like to upgrade to net7 but are not keen on using a preview release in production. |
The new preview is out. The largest (breaking) change compared with the previous preview is that the A couple of extensions for setting coding functions are marked obsolete and aggressively disabled by throwing a not implemented exception. I think they should be removed so the incompatibility can be found and resolved at runtime. The drawback is of course that the |
I think (and hope) that this is a typo and that NET Standard 2.0 is still going to be supported in v109. |
It is, you are right
|
Btw, the media type issue is a bug in .NET 7, still open dotnet/runtime#81506 |
I am still considering getting back the client-level cookie container for cases when a singleton client is used, and the container will have authentication cookies. |
Finally the v109 branch has all the PRs merged with all the test passing. |
For me everything works fine with. Thanks for working on RestSharp. I have used the 109.0.0-preview2. Is there a newer package for the latest changes of the v109 branch to test? |
There's an issue there with cookies in the response. If the request has no cookies, which it doesn't by default, the response cookies won't be propagated to |
v109 is out. Big thanks to everyone who contributed by code and comments/suggestions! |
I used |
@alexeyzimarev Docs need updating - https://restsharp.dev/serialization.html#newtonsoftjson-aka-json-net still recommends |
Also, I think
should be
|
Updated the docs |
@alexeyzimarev Do you know what happened to |
They made it internal. This library really likes changing everything around very frequently. It's painful. |
Agree, very painful. I've got 30+ projects failing builds right now. Think I'll be sticking with 108 for the time being until the bugs are ironed out. |
@nsulikowski the I actually found out that exposing Not sure that to do about it though. I opened a new issue for it: #2025 |
I think the discussion about |
No worries, this happens in software development! Not sure about other people's use cases but I was simply using Mostly this is for response/error logging, and is easy for me to replicate using I've not come across any other breaking issues, but there could be other methods that are no longer publically exposed in RestSharp. |
Thanks for the explanation. It would be great to continue the conversation in #2026. |
I don't think so, as RestClient didn't have many public methods, and |
@alexeyzimarev can you please help us understand how you ran into the .NET 7.0 runtime issue? |
@karelz I didn't, I got a few issues opened by people who migrated to .NET 7 and suddenly started to get their code crashing when it worked before. Because I didn't know the motivation behind that breaking change, it was fixed here, it wasn't hard. |
@alexeyzimarev ok, so your (RestSharp) customers ran into the breaking change in Runtime, but reported it to you and you fixed it (worked around it) in RestSharp. Did I get it right? Thanks for your help BTW, appreciate it! (hopefully my questions are not too demanding) |
@karelz That's correct. Here are the issues:
It was fixed here as part of the v109 PR, which has lots of changes for that release. Here's the commit that addresses the media type header issue: 193b6ca |
RFC for v109.
New features
Done, awaiting feedback
IRestClient
interface withOptions
,Serializers
,ExecuteAsync
, andDownloadStreamAsync
Planned
RestClientFactory
implementation. It is unclear if we should useIHttpClientFactory
or an internal factory like it's done by Flurl. Using both might work too.Breaking changes
UseXXX
methods to configure serializers moved to theSerializerConfig
Authenticator
,Encode
,EncodeQuery
moved toRestClientOptions
Options
exposed by the client changed the type toIRestClientOptions
where most of the properties are get-only. Also, properties that configureHttpClient
orHttpMessageHandler
are not included toIRestClientOptions
.Motivation
The client instance should not be as mutable as it is today. The current API allows making configuration changes at runtime, which can produce undesired side-effects when the client instance is used in multi-threaded scenarios.
Example serializer configuration
Before:
After:
The text was updated successfully, but these errors were encountered: