convert curl to c# code

How do I convert the following curl code to c#?

curl -X POST -H "Content-type: application/json" -H "Authorization: BeGlobal apiKey=<YOUR API KEY>" -d '{"text":"Hello Developers", "from":"eng", "to":"fra"}'

Open in new window

Who is Participating?
esak2000Connect With a Mentor Author Commented:
I found this:

but I don't seem to be converting it properly, because I'm getting an authorization denied error
Dave BaldwinFixer of ProblemsCommented:
It is unlikely that you will be able to duplicate cURL functions in C# but you can apparently link to 'libcurl.dll' which does the important work.  This page has a link to a project ( ) and some info about using the dlls.
Dave BaldwinFixer of ProblemsCommented:
Before you try to connect to an API, try to use a simple cURL procedure that just GETs a web page to make sure the basic code and dlls are working.
esak2000Author Commented:
The above code worked, the authorization was something that needed to be worked on with the provider's API
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.