Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Ivan Temchenko
@35359595
Hi, is it possible to ignore SSL/TLS errors with RestSharp execute?
oh, ServerCertificateValidationCallback works just fine =)
xiaohaoWit
@xiaohaoWit
Thank you for your reply!
Maksim Kislyakov
@Gradi
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?
itadder
@itadder
hello
so I would add enduser as a parmeter
in the request and it value would some Foo@example.com
itadder
@itadder
hi
anyone around
Inojin
@Inojin
hi
Alexander
@MalveiraAlexander
support uwp?
Alexey Zimarev
@alexeyzimarev
@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
@g2petter
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)))
                    {
                        file.BaseStream.CopyTo(s);
                    }
                },
                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
@g2petter
@alexeyzimarev , didn't know I'd find you here! :)
Alexey Zimarev
@alexeyzimarev
Haha
You can’t escape
You know that you can use an overload of AddFile that accepts the stream reading delegate?
Petter Vegsund Brodin
@g2petter
I realized when looking into it after I posted it, so I'll be doing that now
Alexey Zimarev
@alexeyzimarev
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
@g2petter
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.
pornstache321
@pornstache321
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
thorthumb00
@thorthumb00
Hi all. Can anyone recommend a restsharp code example that implements a search function?
Daan De Lombaert
@DaanDL
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
kikootwo
@kikootwo
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
@35359595
@kikootwo is [JsonIgnore] attribute on target property is sufficient for you?
kikootwo
@kikootwo
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!
kikootwo
@kikootwo
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?
richwaring
@richwaring
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
@santo2
Hi guys, for the RestClient, should that be used as a singleton in your application lifetime?
Stf Kolev
@stfkolev
Greetings, is the docs in the website all that is available to its' current version?
Andrew Ovchinnikov
@andreyIM_twitter
Hi guys. I've noticed that in NuGet RestSharp version 106.6.9.0 has a strong name 106.6.9.0 and starting 106.8.0 it has StrongName version 106.0.0.0. Should it be a bug? This is causing issues with RestSharp being referenced as subdependency by other libraries.
Donovan Edye
@natiki
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?
AtlantisDe
@AtlantisDe
help me ,pls. I Need the RestSharp Post Demo restsharp/RestSharp#1431 thanks
Alexey Zimarev
@alexeyzimarev
@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.
aramacciotti
@aramacciotti
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
@michaelvdnet
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
@MelonCoffeeStudios
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
@driekus77
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