Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
Ivan Temchenko
Hi, is it possible to ignore SSL/TLS errors with RestSharp execute?
oh, ServerCertificateValidationCallback works just fine =)
Thank you for your reply!
Maksim Kislyakov
Hello everyone. Does RestSharp always set Connection: keep-alive header or i have to manually set it every time i make request? Second question is How can i set http version?
so I would add enduser as a parmeter
in the request and it value would some Foo@example.com
anyone around
support uwp?
Alexey Zimarev
@pizycki RestSharp supports .NET Framework 4.5.2 and .NET Standard 2.0, just like it is shown in the nuget package page
@Gradi you can use client.AddDefaultHeader to set any header to be sent for each request that is executed by that client
@MalveiraAlexander not sure what are you trying to say/ask
Petter Vegsund Brodin
We've been having some permission problems with adding files to an IRestRequest using the AddFile(string name, string path, string contentType = null) method, and I think maybe there's an issue with the FileStream that's being used.
The method reads like this:
        public IRestRequest AddFile(string name, string path, string contentType = null)
            var f = new FileInfo(path);
            var fileLength = f.Length;

            return AddFile(new FileParameter
                Name = name,
                FileName = Path.GetFileName(path),
                ContentLength = fileLength,
                Writer = s =>
                    using (var file = new StreamReader(new FileStream(path, FileMode.Open)))
                ContentType = contentType

I wonder if this FileStream constructor actually requires both read and write permissions:

new FileStream(path, FileMode.Open)

I think that in order to only request read access (which I assume should be enough for the purpose of adding a file to a request) you need to call this constructor instead:

new FileStream(path, FileMode.Open, FileAccess.Read)

Petter Vegsund Brodin
@alexeyzimarev , didn't know I'd find you here! :)
Alexey Zimarev
You can’t escape
You know that you can use an overload of AddFile that accepts the stream reading delegate?
Petter Vegsund Brodin
I realized when looking into it after I posted it, so I'll be doing that now
Alexey Zimarev
If you think we ask for too broad permissions for the file, open an issue on github please
Better submit a PR :smile:
Petter Vegsund Brodin
I thought it might be good to check if it's intentional or not. There might be a reason that I'm not seeing for why you'd require write permissions as well.
restsharp seems to clean up urls automatically... how the fuck do i make it not do that. For example, working with a weird api that has a query string like this: 1m3434&1d34534&2m4353 etc. No values, only keys in the query string. Restsharp just gets rid of the keys all together
Hi all. Can anyone recommend a restsharp code example that implements a search function?
Daan De Lombaert
Does anybody know how one can send a "Date" header in a custom format?
I'm having trouble with it because "Date" is a restricted header and it gets overwritten internally
I googled for quite a while but couldn't find an answer. Is there a way to ignore properties for json serialization using default serialization with restsharp?
Ivan Temchenko
@kikootwo is [JsonIgnore] attribute on target property is sufficient for you?
That doesn't appear to be present without newtonsoft. But I just tested and it seems that even if I supply additional properties in the json it isn't carrying over to the service side, so I'm good! Thanks!
Another odd issue, each time I restart my application that is using my API written with restsharp the put/delete/post request that I make takes like 15 seconds, after that they take 200ms until I restart the application again. Any ideas?
Hi guys - does anyone use RestSharp within Dynamics 365 plugins? When I upload the plugin to D365 it doesn't seem to be able to find the RestSharp assembly.
Peter Derwa
Hi guys, for the RestClient, should that be used as a singleton in your application lifetime?
Stf Kolev
Greetings, is the docs in the website all that is available to its' current version?
Andrew Ovchinnikov
Hi guys. I've noticed that in NuGet RestSharp version has a strong name and starting 106.8.0 it has StrongName version Should it be a bug? This is causing issues with RestSharp being referenced as subdependency by other libraries.
Donovan Edye
Hi.... I am looking to log the raw requests and responses of a RestSharp client.... As this is in a third party library and all I have access to is the RestClient is it possible to add an interceptor / handler so that I can get the raw traffic?
help me ,pls. I Need the RestSharp Post Demo restsharp/RestSharp#1431 thanks
Alexey Zimarev
@AtlantisDe such questions get closed even on StackOverflow. we keep GitHub issues for bug reports and feature requests only. You can formulate your question better on SO and I am sure people will help.
@andreyIM_twitter I guess you found the reported issue already. It is not a bug but the change happened in a minor version, it is indeed an issue.
Can RestSharp help in create a WCF to WebAPI router that be agnostic about which is the method and parameters received but use them to call the REST endpoint, receive the response and then again route it to the original consumer as a WCF response?
Michael van der Net
Hi, I'm implementing a OAuth1 consumer (twitter), and would like to know if it's possible to change the authenticator per request, so I don't have to make a new client for every request and suffer from socket exhaustion?
Aaron Griffin
Hey all, anyone know when RestSharp 107 is coming out?
Or if it is out
I cannae find it
But it seems as tho it's been talked about for years
Henry Roeland
Hi everybody, I should have come hier first:-) I like using RestSharp a lot. But I’m missing 2 things: pluggable and chain able serializers. And hypermedia support like OData and GrapQL. Am I the only one missing these features? Is RestSharp the appropriate lib for these kind of features? Kind regards