简体   繁体   中英

RestSharp execute sync, not async

Is there a way to use restsharp synchronously? Every method I see in Visual Studio has the "async" postfix and the restsharp main page, (which has the following example):

// execute the request
RestResponse response = client.Execute(request);
var content = response.Content; // raw content as string

Clearly makes the distinction between sync and async requests:

// easy async support
client.ExecuteAsync(request, response => {
    Console.WriteLine(response.Content);
});

How can I access this "Execute" sync method?

I asked in their googlegroups and they said that it is because of "platorm limitations" when using wp7. Pretty neat right?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM