Sam Delaney
Sam Delaney

Reputation: 335

C# - How to use webrequest to mimic a curl call

I have this curl request which I've been able to cobble together from various tutorials, and it works, but I need to be able to do it in C#.

curl -k -d "code=4/blahBLMUeFewxYi7AblahgdBf_7Lm.IrGYEyuzz8QfOl05ti8ZT3bppze2bgI&client_id=xxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com&client_secret=blahjf5z45yLNIjXGSO&redirect_uri=http://localhost&grant_type=authorization_code" https://accounts.google.com/o/oauth2/token

I have no code to look at, as I have no idea where to start.

Does anyone have any tutorial on how to do just this?

Thanks.

Upvotes: 1

Views: 724

Answers (1)

48klocs
48klocs

Reputation: 6113

Have you been using the WebRequest class so far? That would seem to be a sensible place to start.

If you're looking to do OAuth integration, there are client libraries for that.

Upvotes: 0

Related Questions