restsharp

Is it possible to use the signed RestSharp NuGet package with Twilio?

匆匆过客 提交于 2019-12-21 20:38:13
问题 We're using both DocuSign's API which requires the signed version of RestSharp, and we're looking to integrate Twilio which requires the unsigned version. I've spent a bit of time trying to get both DLLs to resolve for each of their dependencies, and haven't had any luck. At this point, I'm hoping there's a way to use the signed RestSharp dll with Twilio. Has anyone had any experience with this before? When I attempt to remove the unsigned RestSharp, my DocuSign code works fine, but now

restsharp - no cookie in response object

感情迁移 提交于 2019-12-21 17:38:07
问题 I have an issue with one of my requests to localhost server. To authenticate, I need two cookies, one from sendReqForToken() method and one from sendLoginReq(string login, string pass). In response I get cookie from sendLoginReq, but not from sendReqForToken(). I don't have idea why one request has a cookie second doesn't. It is interesting that I get correct token(response content is correct) from sendReqForToken() method, but without any cookie in response header. This is sendReqForToken()

Twilio RestSharp Dependency

∥☆過路亽.° 提交于 2019-12-21 12:59:45
问题 I have just updated a MVC web application running on the ASP.NET Framework version 4.5.2. I am using Twilio to send an SMS message: var twilio = new TwilioRestClient(twilioSid, twilioAuthToken); var result = twilio.SendSmsMessage(twilioNumber, message.Destination, message.Body); After the update, I am getting the following error: System.TypeLoadException: Could not load type 'RestSharp.HttpBasicAuthenticator' from assembly 'RestSharp, Version=105.2.1.0, Culture=neutral, PublicKeyToken=null'.

Twilio RestSharp Dependency

不羁岁月 提交于 2019-12-21 12:59:17
问题 I have just updated a MVC web application running on the ASP.NET Framework version 4.5.2. I am using Twilio to send an SMS message: var twilio = new TwilioRestClient(twilioSid, twilioAuthToken); var result = twilio.SendSmsMessage(twilioNumber, message.Destination, message.Body); After the update, I am getting the following error: System.TypeLoadException: Could not load type 'RestSharp.HttpBasicAuthenticator' from assembly 'RestSharp, Version=105.2.1.0, Culture=neutral, PublicKeyToken=null'.

RestSharp get full URL of a request

家住魔仙堡 提交于 2019-12-21 06:55:48
问题 Is there a way to get the full url of a RestSharp request including its resource and querystring parameters? I.E for this request: RestClient client = new RestClient("http://www.some_domain.com"); RestRequest request = new RestRequest("some/resource", Method.GET); request.AddParameter("some_param_name", "some_param_value", ParameterType.QueryString); IRestResponse<ResponseData> response = client.Execute<ResponseData>(request); I would like to get the full request URL: http://www.some_domain

Add a GET parameter to a POST request with RestSharp

一曲冷凌霜 提交于 2019-12-20 12:27:02
问题 I want to make a POST request to a URL like this: http://localhost/resource?auth_token=1234 And I want to send JSON in the body. My code looks something like this: var client = new RestClient("http://localhost"); var request = new RestRequest("resource", Method.POST); request.AddParameter("auth_token", "1234"); request.AddBody(json); var response = client.Execute(request); How can I set the auth_token parameter to be a GET parameter and make the request as POST? 回答1: This should work if you 1

Silverlight: HTTP DELETE and PUT methods with RestSharp

跟風遠走 提交于 2019-12-20 03:17:54
问题 I wanted to access an internal REST API from Silverlight, but it turns out that I am not allowed to use POST or DELETE as the HTTP method for my request. Doing so always resulted in a SecurityException . What is the recommended way to use REST apis with Silverlight? 回答1: SecurityException probably means the API doesn't have the proper clientaccesspolicy.xml file in place. Here's an example of a very lenient one that allows all HTTP methods and headers. We have used this successfully for our

RestSharp response unauthorized

Deadly 提交于 2019-12-20 01:46:54
问题 I am new to web based solutions. I am hitting a rest url using RestSharp library. My code is as follows: var cleint = new RestClient("http://REST_URL"); cleint.Authenticator = new HttpBasicAuthenticator("username", "password"); var request = new RestRequest(); request.Method = Method.GET; request.Resource = "0.json"; IRestResponse response = cleint.Execute(request); if (response != null && ((response.StatusCode == HttpStatusCode.OK) && (response.ResponseStatus == ResponseStatus.Completed))) {

RestSharp response unauthorized

妖精的绣舞 提交于 2019-12-20 01:46:06
问题 I am new to web based solutions. I am hitting a rest url using RestSharp library. My code is as follows: var cleint = new RestClient("http://REST_URL"); cleint.Authenticator = new HttpBasicAuthenticator("username", "password"); var request = new RestRequest(); request.Method = Method.GET; request.Resource = "0.json"; IRestResponse response = cleint.Execute(request); if (response != null && ((response.StatusCode == HttpStatusCode.OK) && (response.ResponseStatus == ResponseStatus.Completed))) {

RestSharp RestResponse is truncating content to 64 kb

若如初见. 提交于 2019-12-19 11:09:11
问题 Hi I am using the RestSharp to create the request to my web API. Unfortunately the response.content does not contain full response, which I am able to see when I perform request through browser or fiddler. The content is being truncated to 64 kb. I am attaching my code below. Could you please advice what could solve this issue? var request = new RestRequest("Products?productId={productId}&applicationId={applicationId}", Method.GET); request.RequestFormat = DataFormat.Json; request