I'm trying to make a post request with the the following code:
string resourceAddress = "url";
string postBody = "jsonbody";
var httpClient = new HttpClient();
httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
HttpResponseMessage x = await httpClient.PostAsync(resourceAddress, new StringContent(postBody, Encoding.UTF8, "application/json"));
I got this compilation error: The 'await' operator can only be used within an async method
Any Ideas? PostAsync returns Task<HttpResponseMessage>
...