Yes, you still call infoUpdate.open() right after you queue the request.
If you don't give your program any chance to actually perform the request, then it can't.
Just consider a real live situation with asynchronous delivers: ordering food in a restaurant
1) you give the waiter your order
2) you immediately try to start eating?
No, that won't work, as the waiter hadn't had time to bring your order to the kitchen, the cook didn't have time to prepare what you've asked for, so the waiter couldn't have brought it back yet
What you really do is
1) you give your order to the waiter
2) you wait until the waiter returns with your meal
3) you eat
In your code the waiter is the HTTP call, the kitchen is the REST server.
You can only start eating (processing the data), once the waiter has returned.
Cheers,
_





Reply With Quote
Bookmarks