Thursday 27 October 2016

c# - How to run an async method synchronously?

In my method:


void myMethod()
{
// other stuff
client.PostAsync(url, content);
}

I want to post something and don't leave myMethod before sending data. It's not possible to make myMethod an async method, so how to wait until data has sent completely before leaving myMethod?

No comments:

Post a Comment

c++ - Does curly brackets matter for empty constructor?

Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...