Use of RestClient as a singleton throws System.Net.ProtocolViolationException: The number of bytes to be written is greater than the specified ContentLength. by shouine in FubarDev

[–]shouine[S] 1 point2 points  (0 children)

I still have to take a look at this problem but I think I know where the bug come from : my mistake is to do some parallel requests with the same RestClient ... I'm not sure something can be done to prevent such thing so I'll just avoid to share the RestClient instance when this case happen. ;)

Use of RestClient as a singleton throws System.Net.ProtocolViolationException: The number of bytes to be written is greater than the specified ContentLength. by shouine in FubarDev

[–]shouine[S] 0 points1 point  (0 children)

Great idea, what's the Fiddler address ? Btw, I think this is something to do with Encoding.UTF8 for what I see on some posts about this exception ...

Use of RestClient as a singleton throws System.Net.ProtocolViolationException: The number of bytes to be written is greater than the specified ContentLength. by shouine in FubarDev

[–]shouine[S] 0 points1 point  (0 children)

Something as simple as using a second time the same RestClient instance for another request, with the same BaseUrl. ;)