Questions tagged [restsharp]
RestSharp is a simple to use REST client library for .NET
2,282
questions
0
votes
0
answers
8
views
Automation - Soap API fails on the second run using RestSharp c#
So I am automating a Soap API test which works perfect the first time when I run it, however after it passed and i receive the xml response and attempt to run it for the second time it fails. I tried ...
1
vote
0
answers
17
views
RestSharp API test running endlessly despite getting desired response - what am I missing out?
RestSharp beginner here; I browsed quite a bit but couldn't find the answers (or the ones I found didn't work out). I am trying to find out what I'm missing in my following test that's checking API ...
0
votes
1
answer
20
views
How to setup In memory cache for RestSharp Client in .NET Core Console Application
I have C# console application in .NET 6.
I am researching the setup of a RestSharp client first i need to setup in memory caching.
I have done an implementation in asp.net that uses System.Runtime....
0
votes
1
answer
23
views
My json keys are getting converted to lowercase once I POST it via RestSharp
Here is my code :
request.AddHeader("Content-Type", "application/json; charset=utf-8");
request.RequestFormat = DataFormat.Json;
request.AddJsonBody(new
{
...
1
vote
0
answers
43
views
System.Text.Json not found even though it is part of the project
I have a Winforms project and I have the latest NET6 (currently 6.0.4) version installed.
I'm using RestSharp and when I created the RestClient I get the following exception:
File or Assembly "...
0
votes
0
answers
24
views
Make parallel calls using RestSharp without instantiating RestClient for every call
I've got a .NET Standard 2.0 library that's used by a variety of projects (.NET Framework, .NET Core, UWP, Xamarin, etc.). It's basically a data client that projects can call to get data from web ...
0
votes
0
answers
13
views
Posting a file with a raw XML using RestClient
I've been using similar XML Posts with success....just that this one calls for ProofPDF which is a byte array.
How can I populate this XML Tag properly... I'm getting an invalid request at the moment....
0
votes
0
answers
15
views
Restsharp Adding Content-Type and Content-Disposition to Binary Streams
We are participating in a process where we provide a vendor with AWS S3 SignedURLs that allow them to upload files to an S3 bucket.
The process is quite simple:
They request a signedurl from us via ...
-2
votes
0
answers
24
views
C# RestSharp API can't Post JSON Body but not show any error
I have some issue
I'm Posting my json body via RestSharp c#, author by Token and method is Post! There're nothing Posted to API but My code is not show any error. When I'm Using Postman to Test my ...
0
votes
0
answers
39
views
How to send on my Web Api ASP.Net Core 6.0 file with two params from WPF app C# using RestSharp STATUS CODE ERROR 44
I have method in my API which receives a file, int and string params. Also I have a desktop WPF app (written in C#) where user after choosing some options click on button and app create request to API ...
2
votes
0
answers
30
views
RestSharp baseUrl with a space
I google it and I pass hours try figure how to do it and I can't figure:
I try get Response from web Api with RestSharp v107 in .net 5
Is works well when I do the baseUrl with out space but when I try ...
0
votes
1
answer
35
views
Multi thread on restsharp API post method
I've got this piece of code that I am looping 100 times. As you can see below the number of loops is declared in the response I get from GET method. So it changes over time depending which number is ...
0
votes
1
answer
31
views
RestSharp.RestResponse instead of json string as Authentication Response
I have been working on using a Rest Api for authentication (https://api.vorexlogin.com/)
So far I have added the RestSharp library to dismiss errors to RestClient and RestRequest.
So far when I run ...
0
votes
0
answers
35
views
Client Certificate not running on Production
I have configured a X509 Certificate using RestSharp on a C# Web application running on .NET Core 3.1. I am able to receive a 200 on all endpoints when on Development, however when published on IIS. ...
0
votes
0
answers
39
views
Placing X509 Certificate as request header on API
I have an endpoint to which I would like to include the X509 certificate that I have just installed as a Current User. I am making use of RestSharp. Below is the code snippet.
I would like to find out ...
0
votes
1
answer
39
views
Restsharp error "Cannot send a content-body with this verb-type."
I am making a call to an eBay api using restsharp. The code follows.
Async Sub fulfillmentPolicies()
Dim request As New RestRequest(sFulfillmentURL, Method.Get)
request.AddHeader(&...
-1
votes
1
answer
146
views
'RestClient' does not contain a definition for 'Execute'
I have been working on getting an api authentication to work and I am currently stuck on getting the response to execute to show up in a text box.
{
private void button1_Click(object sender, ...
0
votes
0
answers
25
views
Deserialize XML / SOAP Response RestSharp
I am trying to deserialize a SOAP response using RestSharp.
The response is:
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Body>
<ns2:...
0
votes
1
answer
39
views
How to use async calls in WPF event handlers
I have this event handler in WPF with async call.
private void Button_Click(object sender, RoutedEventArgs e)
{
var folderStructure = restApiProvider.GetFolderStructure();
}
Here is the ...
0
votes
0
answers
47
views
Using RestSharp to request a file fails with memory issue
I have to API's talking to each other on Kubernetes. The first API asks the second API for a small file using RestSharp (in ASP.NET). The file is 8Kb so basically not large at all.
Yet i get the ...
0
votes
0
answers
51
views
Using RestSharp to aend files between to API's on Kubernetes
So I have to API's running on Kubernetes. One has a controller function as such:
string filePath = "/blobs/data/runsession/" + folderName;
if (!Directory.Exists(filePath))
return null;
...
0
votes
0
answers
32
views
Problem to make external requests with restsharp
At first the problem is simple but I'm wasting weeks with this.
I have a WEB API developed in .NetCore and inside it I make requests to other APIs, locally I don't have any problems, but when I upload ...
1
vote
1
answer
45
views
RestSharp + Xamarin - "Request failed with status code InternalServerError"
This code until recently worked normally. Now it always gives the error "Request failed with status code InternalServerError".
I tested it in Postman, and everything works as expected. The ...
0
votes
1
answer
21
views
Sending HTTP request to Logic app fails with " Property selection is not supported on values of type 'String'
So I have a fairly simple logic app that does a task for me, and I have a HTTP trigger on the task with a JSON object that it expects.
I am calling that logic app trigger from C# as follows :
...
0
votes
1
answer
23
views
RestSharp issues integrating with zscaler product will not work on IIS Server 2012 R2
Our organization is removing our proxy web servers and integrating Zscalar. We were informed that all we had to do is remove the proxy property/settings. So I have removed the proxy setting from my ...
2
votes
1
answer
70
views
GET request works on Postman but fail with RestSharp
I know that similar questions have been already posted in the past but I read a lot on the subject and still couldn't find an answer to my problem.
I have a GET request that works fine on Postman:
I ...
0
votes
1
answer
57
views
After sending HttpRequest with RestSharp and Reading Cookies, When I pass cookie list to another function some are missing
So like the title says, I send the bootstrap request and receive 7 cookies back from it. I verified in debugging that first function is getting all 7 cookies, however when Function #2 starts executing,...
-1
votes
0
answers
54
views
How can I consume an API in ASP.NET with C#, RestSharp and display the obtained data in a DropdownList?
I need help on how to fill a dropdownlist in ASP.NET with c#, with the data I get from a web API (JSON), I've tried several ways and I can't make it work.
this is my method
protected async Task ...
-2
votes
0
answers
15
views
How to send a json body using rest sharp code
{
"ReleaseQueues": [{
"PrintJobId": fg,
"PrinterId": "45",
"BinId": 10,
"StartPage": 1,
"EndPage": 1,
"Orientation": 1,
&...
-1
votes
0
answers
16
views
I have 3 login credentials eg: username ,password and Database name in our application how to set authentication for restsharp
I have 3 login credentials eg: username ,password and Database name in our application how to set authentication for Restsharp
var client=new RestClient("http:********");
client....
0
votes
0
answers
52
views
Unable to establish SSL connection to ejabberd using RestSharp, " Received an unexpected EOF or 0 bytes from the transport stream" error
Me and my collage group have set up an ejabberd server in a docker container for a chat application and Im attempting to call the ejabberd api from a C# RestSharp call.
the C# code is:
public ...
0
votes
1
answer
31
views
Post JSON Object RestSharp v107
I have to post this json data:
JSON.stringify(dataRest) is:
{"Ds_MerchantParameters":"...
0
votes
1
answer
68
views
Unable to connect and get data from remote local Rest API with VPN proxy
I'm trying to connect to a remote local server to get data from their Rest API. I'm on a ASP.NET MVC project and using RestSharp. When I establish VPN connection to the remote local server (via ...
-1
votes
2
answers
89
views
Absolutely lost with RestSharp
I am pretty new to C# and want to create a REST Get request with Basic auth.
I'm using RestSharp but i can't find a proper working full example.
This is my code:
using RestSharp;
using RestSharp....
0
votes
1
answer
29
views
Why am I receiving 401 Unauthroized from CardPoint API when using test credentials
I am trying to test CardConnect's API, and whenever I make a request to https://fts.cardconnect.com:6443/rest/auth I receive an unauthorized response. I've tried rolling back the version of rest sharp ...
1
vote
1
answer
44
views
Call to ApiClient.RequestJWTUserToken is throwing a RestSharp exception
I have an empty test web page calling ApiClient.RequestJWTUserToken() as shown below and it immediately throws the RestSharp exception following:
OAuth.OAuthToken authToken = ApiClient....
1
vote
2
answers
50
views
RestRequest Parameters adding logic
I am having some issues finding information about adding some logic field in my RestRequest using V 107. I am trying to add a filter to my GET query
dl_document_indexed_date gt '2020-12-07T08:30:42....
0
votes
1
answer
52
views
RestSharp call to eBay oauth2 user token
I am trying to get eBay user tokens for my users using the identity api. I finally got it to work in Postman. Converted the call from Postman to a restsharp call from a vb.net test app. The Postman ...
-2
votes
1
answer
100
views
RestSharp doesn't work on ASP.NET Core (HTTP POST method)
Login model code:
namespace Tools.Models
{
public class Login
{
[Required(ErrorMessage = "The username field is required")]
public string username { get; set; }
...
0
votes
1
answer
83
views
Restsharp 107.x ExecuteAsync upload file to uploadsession fails (GraphAPI Sharepoint), 106.x does work
I have my below code which works proper on 106.15, I get a succesfull status. Project is Visual Studio 2022 (.Net 4.8)
accessToken = GetAccessToken()
Dim rRequest As RestRequest
Dim rClient As ...
1
vote
0
answers
39
views
RestSharp API POST - identical data different return status
I have Test Data defined as follows:
public static string body = @"#--------1---------2---------3---------4---------5-------
#PlanetName Loc. UPP Code B Notes Z PBG Al
#---------- ...
0
votes
1
answer
53
views
RestSharp v107 Parameter question adding nested JSON / objects
I'm attempting to update my RestSharp calls to v107 and noticed a slight difference in how parameters are added. What I have working in 106 doesn't appear to work in 107.
What I have is that I'm ...
0
votes
1
answer
20
views
restsharp 107.3.0.0 different signatures with different visual studio versions
I am trying to build using restsharp version 107.3.0.0, the left screen is visual studio 2022 and the right screen is visual studio 2017.
The assembly version is the same in both, however visual ...
0
votes
1
answer
47
views
Why do I keep getting "Missing/Malformed URL Parameters" when consuming my API in C# (RestSharp) with VS 2022?
I'm trying to do a POST request in C#, using RestSharp, in Visual Studio 2022.
I tested the API using Postman, which was successful. The API requires a 64-bit encoded Basic Auth (which I have), and a ...
1
vote
1
answer
21
views
ServiceStack HTTP Utils
I’ve to make a post request to a service (not implemented with ServiceStack). From the docs, please correct me if I am wrong, I have to use HTTPUtils nuget package (v. 6.0.2), but if I make a request ...
0
votes
2
answers
125
views
Async method - weird behavior: my app is getting stuck
I have a weird problem with my async method. I made second project in my solution in VS to connect my app to an API (using RestSharp for it). I made dependencies etc.
The problem is when I call this ...
0
votes
0
answers
42
views
RestSharp XML response to Object
I am receiving the following XML response from a 3rd party API (which I cannot change):
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<...
0
votes
0
answers
24
views
Using RestSharp I ever see "{\"message\": \"TypeError: sign() takes at least 2 arguments (0 given)\", \"exception\": \"TypeError\"}"
I using RestSharp (v 107.3.0.0) to post data on a Web API, when I using postman to test te post is ok, bu when I using RestSharp ever I receive:
"{"message": "TypeError: sign() ...
2
votes
1
answer
147
views
Cannot assert Bad Request [HTTP 400 error] using RestSharp. Throws System.Net.Http.HttpRequestException
Using RestSharp I have written the following test and the expected outcome is to return error 400 with some error messages in Json format.
But the following test fails at await client.PostAsync(...
0
votes
1
answer
36
views
WebAPI call using RestSharp gives status 404; WebRequest succeeds
I've got a section of code to do a call to an external webapi using WebRequest. I'm trying to update it to use RestSharp instead. What am I missing here to make the conversion? The closest question ...