HttpClient and PCL

Being new to Xamarin, I am finding it hard to know what is in PCL and what isn't.

I am trying to use HttpClient to send a Post request and retrieve a JSON string. Below is my code but the response line has a syntax error with "The await operator can only be used within an async method"

var client = new HttpClient();
var content = new FormUrlEncodedContent(postData);
HttpResponseMessage response;
response = await client.GetAsync("https://.....", content);

Any help is greatly appreciated!________

Best Answer


  • Thanks! That helped a lot!!!

Sign In or Register to comment.