restsharp

Fiddler4 in windows server 2012 provokes RestSharp Requests to be null

为君一笑 提交于 2020-01-06 07:37:28
问题 So I'm testing Neo4J in pure REST (no Neo4JClient) and I have this code: var client = new RestClient("http://url"); string requestText = "{ \"query\" : \"start x = node(1) match path = (x--IsFriendOf) return path, IsFriendOf.name\", \"params\" : { }}"; var request = new RestRequest(); request.Method = Method.POST; request.RequestFormat = DataFormat.Json; request.Resource = "/foo/bar"; request.AddHeader("Content-Length", requestText.Length.ToString()); request.AddHeader("Host", "ip:port");

Deserializing nested JSON arrays using RestSharp

白昼怎懂夜的黑 提交于 2020-01-05 23:46:54
问题 I'm trying to deserialize the following JSON response using RestSharp. I have tried various model structures to extract the data to no avail. I keep getting tripped up on the nested arrays. I do not have control over the service, so I can't change the format. JSON Format: [ { "results": 19, "statuscode": 200, }, [ { "id": 24, "name": "bob" }, { "id": 82, "name": "alice" } ] ] Using this model, I've been able to pull the data from the first object, but that's all. I'm not sure how exactly to

Is single Request object instance in REST client okay?

醉酒当歌 提交于 2020-01-05 12:30:52
问题 I'm writing a simple REST client for a C# WinForm application. I use RestSharp to make sending requests and getting responses easier. I have a few questions regarding how I should design my client. The user interacts with the client only once. He pushes a Button and the client is instantiated and passed to private methods to do some logic in the background. It accesses objects from the server and synchronizes them with objects in the user's internal database. The point is that the client's

Refreshing in RestSharp for Windows Phone

故事扮演 提交于 2020-01-04 04:36:08
问题 I implemented RestSharp succesfully in my WP7 application, but one issue remains: When I load resources from the server (for example a GET request on http://localhost:8080/cars), the first time the collection of (in this case) cars is succesfully returned. When I issue the same request for the second time, I always get the same result as the first time - even when the resources have changed in the meantime. When looking at my server, the second time there is no request issued at all. I

Dispose Object Of RestRequest RestSharp?

社会主义新天地 提交于 2020-01-03 15:20:51
问题 I am working with RestSharp and create object of RestRequest for sending FileData to API. But after getting response I want to delete the file from my local machine but when I try to do the same it gives me the error " File is being used by other process ". The reason I think is that I am unable to dispose the object of RestRequest. Please help me to solve it. Below is the code. Thanks in Advance..!!! public string PostMultiformDataAPI(Method method, string apiUrl, string data = "",

Dispose Object Of RestRequest RestSharp?

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-03 15:19:03
问题 I am working with RestSharp and create object of RestRequest for sending FileData to API. But after getting response I want to delete the file from my local machine but when I try to do the same it gives me the error " File is being used by other process ". The reason I think is that I am unable to dispose the object of RestRequest. Please help me to solve it. Below is the code. Thanks in Advance..!!! public string PostMultiformDataAPI(Method method, string apiUrl, string data = "",

How do I install and setup RESTSharp without NuGet?

﹥>﹥吖頭↗ 提交于 2020-01-02 01:22:06
问题 I am using Visual Studio C# 2010 Express and is learning. RESTSharp is supposed to be installed by NuGet but NuGet cannot be used with Express version. Can I still install and configure RESTSharp manually, and how? 回答1: The NuGet Visual Studio plugin can't be used with Express, but you can install NuGet packages from the command line. You'll need to download the command line bootstrapper from the NuGet CodePlex site. After installing it, you can just use nuget Install SomePackageName and it

Get JSON response using RestSharp

梦想与她 提交于 2020-01-02 00:51:16
问题 I'm new to C# and I'm trying to get the JSON response from a REST request using RestSharp; The request I want to execute is the following one : "http://myurl.com/api/getCatalog?token=saga001" . It works great if I'm executing it in a browser. I've tried this : var client = new RestClient("http://myurl.com/api/"); var request = new RestRequest("getCatalog?token=saga001"); var queryResult = client.Execute(request); Console.WriteLine(queryResult); And I get "RestSharp.RestReponse" instead of the

Convert pdf file received in string variable to byte array in C#

安稳与你 提交于 2019-12-31 04:21:11
问题 I am trying to develop an application in C# which takes data from Service1(3rd party), processes it and then sends data to Service2(again 3rd party). The data I am trying to receive, process and send is a pdf file From Service1, I am receiving pdf file in a string variable. e.g. response.Content = "%PDF-1.4 \n1 0 obj\n<<\n/Pages 2 0 R\n/Type /Catalog\n>>\nendobj\n2 0 obj\n<<\n/Type /Pages\n/Kids [ 3 0 R 17 0 R ]\n/Count 2\n>>\nendobj\n3 0 obj\n<<\n/Type /Page\n/Parent 2 0 R\n/Resources <<\n

How to upload multiple files with restsharp? [duplicate]

醉酒当歌 提交于 2019-12-29 09:25:11
问题 This question already has answers here : Sending HTTP POST Multipart/form-data field using RestSharp (2 answers) Closed 2 years ago . I want to upload files to this api https://support.crowdin.com/api/add-file/ How can I create a parameter named files and add multiple files to it using RestSharp? I wrote this code so far but it doesn't work, RestSharp does not seem to upload the file as intended. var addUrl = new Uri($"https://api.crowdin.com/api/project/{projectIdentifier}/add-file?key=