DanielMoncadaZ DanielMoncadaZ - 2 months ago 10
C# Question

How i change this curl POST request into a c# code

I'm trying to make a HTTP POST request using C# and this is all I know:

I have a template that is just plain text. They recommend storing it in a separate file, which makes it easier to pass to the request. and here is an example, if the template is in a file called

this should be the call:

curl -X POST 'https://integrations.expensify.com/Integration-Server/ExpensifyIntegrations' \
-d 'requestJobDescription={....}' \
--data-urlencode 'template@expensify_template.txt'

and I have to make a code to send that request through c# using Visual Studio

Answer Source

The answer is here - specifically Method A where it says var content = new FormUrlEncodedContent(values); where values would be the result of your reading the text file that contains your template.