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?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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.
esak2000Author Commented:
I found this:

but I don't seem to be converting it properly, because I'm getting an authorization denied error

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.