I have an issue where a function is not being called. My guess is that it is a synchronization problem.
Here is the code:
await context.PostAsync("Foo Bar");
The function below doesn't seem to be called if I put it before or after the POST to the web server.
context.Call(new QuestionFourDialog(), this.QuestionFourResumeAfter);
Uri baseUri = new Uri("http://somedomain.com/");
UriBuilder builder = new UriBuilder($"{baseUri}/analytics/message?");
using (WebClient webclient = new WebClient())
{
webclient.Encoding = System.Text.Encoding.UTF8;
webclient.Headers.Add("Content-Type", "application/json");
string postBody = $"{{\"message\": \"{this.answer}\", \"key\": \"7F02D18E-88E7-486D-B51F-550118491CB1\"}}";
webclient.UploadString(builder.Uri, postBody);
}
Is there a way I can call the POST code asynchronous or another way to solve this issue ?