restsharp

Get Coinbase wallet list with RestSharp library

纵饮孤独 提交于 2019-12-13 03:30:25
问题 I need to retrieve the list of wallets of a Coinbase account. In order to to it, I need to use RestSharp (no third library allowed), using the API private keys. I've tried to retrieve them but when I run the code, as response I obtain a invalid response, with an error message that says "The URI prefix is not recognized." How can I retrieve the list of wallets? This is my code: using RestSharp; using System; using System.IO; using System.Linq; using System.Security.Cryptography; using System

simple cURL request with RESTSharp

梦想的初衷 提交于 2019-12-13 03:25:35
问题 I want to execute a simple cURL command with c# curl https://doma.in/to/verify/license \ -d "produkt=test01" \ -d "key=123123123123" \ -X POST What is what is the equivalent to C# or RESTSharp? I tried this: var client = new RestClient("https://doma.in"); var request = new RestRequest("/to/verify/license", Method.POST); But I don't know how to translate this to RESTSharp: -d "produkt=test01" \ -d "key=123123123123" \ -X POST Manpage of cURL says '-d' is for send data but I can't find a send

How to post a JSON Array of Objects in RestSharp

大憨熊 提交于 2019-12-13 02:41:20
问题 I need to pass a JSON Array of objects, here's an example of what it should look like in JSON: "categories": [ { "id": 9 }, { "id": 14 } ], I can't figure out how to get it done by myself, I tried using Restsharp's request.AddBody() and request.AddParameter() but it didn't get me anywhere =/ var request = new RestRequest(); request.AddParameter("name", name); // Category request.AddParameter("categories", "categories here"); var response = client.Post(request); 回答1: If I understand it right

RestSharp in Mono project (MonoDevelop)

别等时光非礼了梦想. 提交于 2019-12-13 02:36:17
问题 I'm doing some Mono project (Mono 2.10.8) and trying to use RestSharp. As I saw on RestSharp page it support Mono. I'm trying to run following simple code : var client = new RestClient("http://www.go2board.com"); var request = new RestRequest(); var result = client.Execute(request); But everytime when I choose Mono 2.10.8 runtime in MonoDevelop IDE I'm getting following error {System.Net.WebException: The request timed out at System.Net.HttpWebRequest.EndGetResponse (IAsyncResult asyncResult)

Problems Deserializing Nested JSON Array in C#

删除回忆录丶 提交于 2019-12-13 01:51:23
问题 Edit I notice this is getting negative votes, I imagine it's for not showing research effort. I've looked at a lot of stack overflow posts. I can't find an example with JSON this heavily nested that has been accessed with examples of how the data stored in the JSON has been manipulated afterwards. Problem and Aim Using restsharp I've received a JSON response to an API call I made however I'm struggling to deserialize the response I'm getting. The data I want to use seems to be a nested array

Data streaming with restsharp and WebAPI

杀马特。学长 韩版系。学妹 提交于 2019-12-13 01:50:27
问题 My aim is to GET and POST files to SP Online. I have written a WEB API with the two methods. These methods use CSOM to interact with SP Online. The GET returns the response Ok(array of bytes) to the client and the POST gets the entire file to upload in the request body and performs the upload to Sharepoint Online in chunks. I've been told that i should use streaming techniques, since the context is an enterprise application with many simultaneous requests. So the GET method should return a

RestSharp Deserialization of empty string to Dictionary Error

那年仲夏 提交于 2019-12-13 01:34:46
问题 I'm a bit new to RestSharp so please excuse my ignorance. I'm getting the following error: {"Unable to cast object of type 'System.String' to type 'System.Collections.Generic.IDictionary`2[System.String,System.Object]'."} This happens when RestSharp tries to deserialize and empty string to a Dictionary object. Here is the my abbreviated Result object: public class Result { public Dictionary<string, string> assignment_group { get; set; } } Here is what is returned if assignment_group is

Is Uri available in some other assembly than System in .NET 3.5, or how can I resolve Uri in this RestSharp code otherwise?

拥有回忆 提交于 2019-12-13 00:44:33
问题 I am trying to get a bare bones bit of RestSharp into my Windows CE / Compact Framework 3.5 app. This minimalistic code: RestClient client = new RestClient("http://192.164.144.42:72921/"); RestRequest request = new RestRequest("api/vendorItems/", Method.GET); RestResponse response = client.Execute(request) as RestResponse; string content = response.Content; // raw content as string ...first caused a problem because I had to change this: RestResponse response = client.Execute(request); ...to

Converting PHP array of arrays to C#

跟風遠走 提交于 2019-12-12 17:15:21
问题 I am writing a C# client for a 3rd party API (I'm using the RestSharp nuget package). Their documentation contains PHP examples which I must translate to C#. Most of their samples are simple enough and I have been able to convert them to C# but I am struggling with one of them because it accepts an array of arrays. Here's the sample from their documentation: $params = array ( 'user_key' => 'X', 'client_id'=> 'X, 'label' => array( array( 'language' => 'en_US', 'name' => 'English label', ),

Using RestSharp in Windows Phone 7

梦想与她 提交于 2019-12-12 15:11:48
问题 I'm trying to use RestSharp (http://restsharp.org/) in a Windows Phone 7 project, but I'm having an issue it seems with the Newtonsoft Json.NET library that RestSharp uses. When I'm trying to execute my code like so: _restClient.ExecuteAsync<Model.Song>(restRequest, (response) => { if (response.StatusCode == HttpStatusCode.OK) { } else { } }); I'm getting the following error: Could not load type 'Newtonsoft.Json.Linq.JArray' from assembly 'Newtonsoft.Json.Compact, Version=3.5.0.0, Culture