Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Async response #127

Open
soareseneves opened this issue Jan 16, 2019 · 1 comment
Open

Async response #127

soareseneves opened this issue Jan 16, 2019 · 1 comment

Comments

@soareseneves
Copy link

Using the Async request example there is no way to get the actual result from the request, how can I get it? Shouldn't the Response Content be added as a parameter of OnAsyncRequestProcess procedure?

@fabioxgn
Copy link
Contributor

@soareseneves I think you've confused the behavior of the Async method. Only the request is made async, your code will block and wait for the request to finish, example:

  Events := FClient.Resource(URL)
    .Accept(RestUtils.MediaType_Json)
    .Async
    .Get<TEvents>;

The advantage is that you can cancel the request at any time if it takes too much time to finish.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants