by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
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
maitevgithub
@maitevgithub
Hi, I successfully generated an access token with RESTSharp. Now I'd like to call an API with that token. How to proceed?
alexkhaos
@ajv_jose_twitter
hi i have aproblem with restsharp
i was working with an api on visual studio, but with framework 4.7.2 and when i sent it to test, they request to make a downgrade of the framework to 4.5.2 and now im not able to get a response form the api
alexkhaos
@ajv_jose_twitter
also how can i get this
RestSharp.Serializers.SimpleJson
cus is request to install the lastest version of the restsharp
Sedat Kapanoglu
@ssg
Hi Folks, the async example on the official page just doesn't compile with the latest version: it says there is no such overload: https://restsharp.dev/getting-started/#asynchronous-calls
Sedat Kapanoglu
@ssg
Nevermind, it was a problem with a stale reference to the older version (.1 instead of .11). :)
advapiIT
@advapiIT
Hello, I assert that I'm new to restsharp and I need to perform a DeleteCall on a service that accepts Delete action
the problem I've is that if I use it sync it works, here's the code
        public  Task<ResponseItem> PerformShipmentDeleteAsync(ShipmentDeleteRequest objectRequest)
        {
            var client = new RestClient(settingsService.Endpoint);

            var request = new RestRequest("shipment", DataFormat.Json);
            request.AddHeader(Constants.XApiKey, settingsService.ApiXKey);
            request.AddParameter( "text/plain",$"id={objectRequest.Id}", ParameterType.RequestBody);

            var res =  client.Delete(request);

            return res.IsSuccessful ?  Task.Factory.StartNew(() => new ResponseItem { Error = 0}) : Task.Factory.StartNew(() => new ResponseItem { Error = 1, ErrorMessage = res.ErrorMessage});
        }
since the delete does not return anything but have to check on return code, if I use the DeleteAsync, it asks me for a callback
and I've not been able to find how to use it correcly
anyone can show me an example please?
DavidHawkes
@db300
ExecuteAsync don't support callback?
Obsolete?
DeveloperM0303
@DeveloperM0303
Hi Folks, I am using RestSharp version 106.11.4.0. I am sending file from my C# application to rest api using request.AddFile(name, path). However, I get the response as bad request. Sample code request.AddFile("00003800", @"C:\Temp\test\00003800.pdf". Any help is appreciated.Thanks!
pawarsum
@pawarsum
Hi Everyone, Facing an issue with Restsharp v 106.11.4 , api returns an status code 0 what does that mean
phungne
@phungne

Hi Everyone, i have issue on my production env
Exception=System.Net.WebException: Only one usage of each socket address (protocol/network address/port) is normally permitted Only one usage of each socket address (protocol/network address/port) is normally permitted ---> System.Net.Http.HttpRequestException: Only one usage of each socket address (protocol/network address/port) is normally permitted ---> System.Net.Sockets.SocketException: Only one usage of each socket address (protocol/network address/port) is normally permitted\r\n at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken)\r\n --- End of inner exception stack trace ---\r\n at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken)\r\n at System.Threading.Tasks.ValueTask1.get_Result()\r\n
at System.Net.Http.HttpConnectionPool.CreateConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken)\r\n
at System.Threading.Tasks.ValueTask1.get_Result()\r\n at System.Net.Http.HttpConnectionPool.WaitForCreatedConnectionAsync(ValueTask1 creationTask)\r\n
at System.Threading.Tasks.ValueTask1.get_Result()\r\n at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken)\r\n at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)\r\n at System.Net.Http.DecompressionHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)\r\n at System.Net.Http.HttpClient.FinishSendAsyncUnbuffered(Task1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts)\r\n at System.Net.HttpWebRequest.SendRequest()\r\n
at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)\r\n --- End of inner exception stack trace ---\r\n
at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)\r\n
at RestSharp.Http.GetRawResponseAsync(IAsyncResult result, Action1 callback)\r\n at RestSharp.Http.ResponseCallback(IAsyncResult result, Action1 callback);`


i'm used cmd: netstat -na to check port so i see a lot of PORT was created.

Any solution for this issue, pls help me

I'm using
  • Restsharp: .NET core 2.2.1 with Reshsharp v106.11.5-alpha.0.2
  • Here my code Client invoke Restfull API
    `RestClient _RestClient = new RestClient(CoreHelper.InnoAppConfig.LinkApiUrl)
              {
                  Timeout = CoreHelper.InnoAppConfig.Timeout,
                  CookieContainer = new CookieContainer() ,
                  Pipelined = CoreHelper.InnoAppConfig.RestConfig.EnablePipelined,
              };IRestResponse<string> response = await _RestClient.ExecuteTaskAsync<string>(_request);
                  return response.Content;`
Sammy Shi
@happysammy
Hi, i just ran into same error message " Only one usage of each socket address (protocol/network address/port) is normally permitted" , so should i need to switch to using HttpClient to solve this problem?
Ghost
@ghost~5ef0c115d73408ce4fe79a20
Hi, I am Santosh, recently started working on RestSharp for RESTAPI testing. Do we have any RestSharp API documentation that I can refer to.
Raptor2277
@Raptor2277
image.png
image.png
image.png
image.png
oops sorry
im having trouble choosing the correct overload
image.png
Ghost
@ghost~5ef0c115d73408ce4fe79a20

Hi, do we have oAuth 2.0 support documentation for RestSharp. I don't find any kind of API documentation for RestSharp in website. https://restsharp.dev/usage/authenticators.html

Please provide some help to locate the documentation

Ghost
@ghost~5ef0c115d73408ce4fe79a20
Can anyone help me with the API docs
Ghost
@ghost~5ef0c115d73408ce4fe79a20
Hello Everyone, Is anyone maintaining this channel? or left abundant> I have asked a question and look for support
phungne
@phungne
@happysammy do you have try this solution ?
Adrian Strangfeld
@AdrianStrangfe1_twitter

Hello everybody. I am facing a deserialization problem. Hopefully someone can help me out.
I have to deserialize a list without a container item. It has the following format:
<root>
<list-item></list-item>
<list-item></list-item>
</root>

instead of

<root>
<list>
<list-item></list-item>
<list-item></list-item>
</list>
</root>

How can I archive it?

I upgraded to the newest rest sharp version hoping the "Content"-Property of the DeserializeAsAttribute would do the trick, but it did not help.
I think I should mention that it is a list inside of a list. I recently had problems with that too. Can Restsharp handle this?
Adrian Strangfeld
@AdrianStrangfe1_twitter
I got it to work using the DotNetSerializer. Is there a way to do it with the other one? (XmlSerializer)
Adrian Strangfeld
@AdrianStrangfe1_twitter
I got it to work: The "Content"-Property of the DeserializeAsAttribute did the trick. I did mess it up on my first try.
Scott Mathson
@smathson_twitter
Hey all, is documentation for older versions of the library available anywhere?
Enrico Rossini
@erossini
Hello everybody. Is there possible to have logs from RestClient?