Open dariusz-wozniak opened 2 years ago
I'd like to translate the following cURL to the Tiny.RestClient request:
curl -v -u yourapikey:X -F "attachments[]=@/path/to/attachment1.ext" -F "attachments[]=@/path/to/attachment2.ext" -F "email=example@example.com" -F "subject=Ticket Title" -F "description=this is a sample ticket" -X POST 'https://domain.freshdesk.com/api/v2/tickets'
When I use the client to post the request:
var rs = await client.PostRequest("tickets") .AsMultiPartFromDataRequest() .AddString("a@a.com", "email") .ExecuteAsStringAsync(CancellationToken.None);
...And I have a cURL listener (client.Settings.Listeners.AddCurl()), the translated cURL is (some data stripped off):
client.Settings.Listeners.AddCurl()
curl -X POST [...] -d "--1c3acb07-77bd-494d-bc56-21290dcd5088 Content-Type: text/plain Content-Disposition: form-data; name=email a@a.com [...]
The "email" param is passed with the -d flag; how can I make the param passed by -F flag?
-d
-F
The actual problem is Freshdesk API and its requirement to have parameters wrapped in quotation marks.
See the thread: https://github.com/restsharp/RestSharp/issues/1744.
I'd like to translate the following cURL to the Tiny.RestClient request:
When I use the client to post the request:
...And I have a cURL listener (
client.Settings.Listeners.AddCurl()
), the translated cURL is (some data stripped off):The "email" param is passed with the
-d
flag; how can I make the param passed by-F
flag?