HttpWebRequests, HTTPClient, XNet, RestSharp?
I've been using HttpWebRequests for as long as I can remember, but RestSharp and XNet look really promising.
HttpWebRequests has it's issues, printing cookies out can be tedious amongst other flaws.
What do you guys use to send requests? Really interested.
Best,
Draxyee
I would probably use the new HttpClient stuff now. HttpWebRequests is not really that great, because you have to configure so much stuff for it to work the same on different computer setups. I wish there was something in the framework that was as easy to use and extendable as the requests library in Python.
I normally use HttpClient because that's what I learned to use and that's what I know best.
I use HttpClient for most of the things I do, but sometimes Leaf.xNet comes in handy.
I switched to HttpClient from HttpWebRequests a while ago. Never heard of xNet or RestSharp, looks interesting.
For the glory of humanity
HttpClient is a solid way to go and offers most stuff you need.
xNet has been the smoothest for me.
(Jul 30, 2020 02:56 PM)hash Wrote: HttpClient is a solid way to go and offers most stuff you need.
Has it's flaws, memory leaks/issues and limits the amount of concurrent connections.
I have a thread about it.
I think XNET looks promising, but I'm probably going to switch to RestSharp soon, I don't know if XNET has the concurrent requests issue, but I've been told RestSharp doesn't.
HttpClient for me, but I XNET looks interesting too... Going to look into that later... 🙄
postman can be utilized for almost anything =]
Grey Hat for educational reasons
Aug 1, 2020 07:31 PM
(This post was last modified: Aug 1, 2020 07:33 PM by MavenGradle.)
(Jul 31, 2020 11:06 PM)Aliаs Wrote: postman can be utilized for almost anything =]
Mind explaining what made you suggest a tool like postman in a thread about C# programming libraries and .NET features?
Are you hooking into the postman UI to perform webrequests in C# 😒?
Looking to build some bots, so I will definitely check out some of these frameworks.
Always used curl for this, never had problems with it.
Is there a reason RestSharp hasn't been mentioned yet? I feel like this is just my natural go to nowadays. The memory leaks being referred to with HttpClient is due to a bug on your implementation not a bug on HttpClient. I've used it with millions of requests without a problem at extremely high throughput.
(Aug 3, 2020 02:45 AM)Shadow_Cloud Wrote: Is there a reason RestSharp hasn't been mentioned yet? I feel like this is just my natural go to nowadays. The memory leaks being referred to with HttpClient is due to a bug on your implementation not a bug on HttpClient. I've used it with millions of requests without a problem at extremely high throughput.
The problem is it doesn’t allow for my implementation. I can’t share a single HTTPClient, as I need to change proxy after a request has been made. HTTPClient doesn’t allow you to modify the proxy after a request has been sent, rendering the reuse of a singleton client as useless (if that was your memory leak fix).
|