restsharp

Access Etsy API oauth using c# RestSharp

守給你的承諾、 提交于 2020-01-14 03:57:25
问题 I set up a developer acct under our shop, to access our sales receipts. I decided to use RestSharp to make my requests. I have proved it works for none Oauth required calls. I have successfully received my accessToken and accessTokenSecret. So i use those along with the customerKey and customerSecret to make a ForProtectedResource call, for a oauth request as follows but always receive "This method requires authentication". I'm hoping its something simple I'm missing. I thought, all I need to

RestSharp POST request translation from cURL request

牧云@^-^@ 提交于 2020-01-11 09:42:19
问题 I'm trying to make a POST request using RestSharp to create an issue in JIRA, and what I have to work with is an example that uses cURL. I'm not familiar with either enough to know what I'm doing wrong. Here's the example given in cURL: curl -D- -u fred:fred -X POST --data {see below} -H "Content-Type: application/json" http://localhost:8090/rest/api/2/issue/ Here's their example data: {"fields":{"project":{"key":"TEST"},"summary":"REST ye merry gentlemen.","description":"Creating of an issue

Request timeout from ASP.NET Core app on IIS

浪子不回头ぞ 提交于 2020-01-11 04:48:11
问题 I make a web request to a third-party api from my ASP.NET Core application. When app is running alone itself, request succeeds. When app is running in IIS on the same server, request timeouts. Request is made from a Hangfire recurring job to Asana API endpoint (HTTPS) via RestSharp client. All the own app's pages are available through IIS, but app cannot make any requests. Where should I look and what to debug to solve this problem? 回答1: IIS behavior is driven by the web.config, I have

RestSharp compress request while making rest call to server

眉间皱痕 提交于 2020-01-11 03:55:07
问题 I am consuming a rest api written in java in my C# client. I was pumping hell lot of data to server and I was using RestSharp.dll for the purpose of making rest calls. What I will do is construct an object and add that directly in body of RestSharp request object and mention .netserializer for it. So it will automatically serialize it and post it. All works great. Now I need to apply LZO or GZIP compression. So that server will have less load. I know how to implement both compression

Can RestSharp send binary data without using a multipart content type?

廉价感情. 提交于 2020-01-09 17:49:50
问题 I have been using AddParameter to include XML bodies in my HTTP requests: request.AddParameter(contentType, body, ParameterType.RequestBody); However, this does not seem to work for non-string bodies. (RestSharp's Http.RequestBody is a string for some reason.) I tried using AddFile() , but I can't find any way to avoid encoding the "file" as multipart/form , even if I've only supplied a single object. I'm not at all opposed to underhanded reflection to solve this problem, but I'm hoping to

Can RestSharp send binary data without using a multipart content type?

╄→гoц情女王★ 提交于 2020-01-09 17:47:38
问题 I have been using AddParameter to include XML bodies in my HTTP requests: request.AddParameter(contentType, body, ParameterType.RequestBody); However, this does not seem to work for non-string bodies. (RestSharp's Http.RequestBody is a string for some reason.) I tried using AddFile() , but I can't find any way to avoid encoding the "file" as multipart/form , even if I've only supplied a single object. I'm not at all opposed to underhanded reflection to solve this problem, but I'm hoping to

Can RestSharp send binary data without using a multipart content type?

孤者浪人 提交于 2020-01-09 17:45:23
问题 I have been using AddParameter to include XML bodies in my HTTP requests: request.AddParameter(contentType, body, ParameterType.RequestBody); However, this does not seem to work for non-string bodies. (RestSharp's Http.RequestBody is a string for some reason.) I tried using AddFile() , but I can't find any way to avoid encoding the "file" as multipart/form , even if I've only supplied a single object. I'm not at all opposed to underhanded reflection to solve this problem, but I'm hoping to

Can RestSharp send binary data without using a multipart content type?

大城市里の小女人 提交于 2020-01-09 17:43:27
问题 I have been using AddParameter to include XML bodies in my HTTP requests: request.AddParameter(contentType, body, ParameterType.RequestBody); However, this does not seem to work for non-string bodies. (RestSharp's Http.RequestBody is a string for some reason.) I tried using AddFile() , but I can't find any way to avoid encoding the "file" as multipart/form , even if I've only supplied a single object. I'm not at all opposed to underhanded reflection to solve this problem, but I'm hoping to

Can RestSharp send binary data without using a multipart content type?

こ雲淡風輕ζ 提交于 2020-01-09 17:43:15
问题 I have been using AddParameter to include XML bodies in my HTTP requests: request.AddParameter(contentType, body, ParameterType.RequestBody); However, this does not seem to work for non-string bodies. (RestSharp's Http.RequestBody is a string for some reason.) I tried using AddFile() , but I can't find any way to avoid encoding the "file" as multipart/form , even if I've only supplied a single object. I'm not at all opposed to underhanded reflection to solve this problem, but I'm hoping to

Restsharp - how to serialize a list of enums to strings

孤人 提交于 2020-01-07 02:45:15
问题 I have an List<AnimalsEnum> Foo property in a class that I'm serializing to XML with RestSharp for the body of a request. I'd like the output to be: <rootNode> ... existing content... <Foo>Elephant</Foo> <Foo>Tiger</Foo> .... more content Instead, for the relevant serialisation part, I have <Foo> <AnimalsEnum /> <AnimalsEnum /> </Foo> I'd like to convert the enum values to strings and remove the container element that is automatically added. Is this possible with RestSharp? I thought it may