-1

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 expensify_template.txt 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

Kohei TAMURA
  • 4,970
  • 7
  • 25
  • 49
  • https://stackoverflow.com/questions/4015324/http-request-with-post – Shahein Moussavi Jul 15 '17 at 00:34
  • i know how to send the HTTP request with post only till i get to the --data-urlencode, i have already send this part: curl -X POST 'https://integrations.expensify.com/Integration-Server/ExpensifyIntegrations' \ -d 'requestJobDescription={....}' i'm having a trouble with this one: \ --data-urlencode 'template@expensify_template.txt' – DanielMoncadaZ Jul 15 '17 at 01:07
  • The answer is in the linked post still - 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. I'll remove the possible duplicate comment, however, since that question isn't specifically related to what you're asking. – Shahein Moussavi Jul 15 '17 at 01:44
  • Thank You VERY MUCH that was really really helpfull!! – DanielMoncadaZ Jul 15 '17 at 03:39
  • You're welcome :) I'll post that in an answer if you want to accept it. – Shahein Moussavi Jul 15 '17 at 03:58

1 Answers1

0

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.

Shahein Moussavi
  • 349
  • 2
  • 13