I have external partner that uses REST API based call to our ORG to get some info. Based on data provided by the partner, we do a HTTP callout to an external system to get some other data. So before I could get the response back from the external system, my API is responding back to the partner with empty JSON.
So I am trying to delay the response back or may be hold off until I get all the data from external system. So trying to see what are my options?
Apex Code does wait on the other system, but not indefinitely. You can increase the wait time up to 120,000 ms by using HttpRequest.setTimeout(Integer). If the other system requires more time, you cannot access them in Apex Code. You would need to work with the system you are calling to make their responses faster.
Sorry was in hurry to log off..
Here's the situation,
I have external partner that uses REST API based call to our ORG to get some info. Based on data provided by the partner, we do a HTTP callout to an external system to get some other data. So before I could get the response back from the external system, my API is responding back to the partner with empty JSON.
So I am trying to delay the response back or may be hold off until I get all the data from external system. So trying to see what are my options?
Thanks for trying to help,
Manohar
But that doesnt work in RestContext. or is there a way to make it work?