Please help me to sole this problem. I have the case where I need to get the last response of the same API call, but it's async call and I don't know how to handle this. The problem is that I can have more than one requests for the same 'API/someEvent' but I need to validate the response data of the last one only.
var postData;
page.Response += (_, response) =>
{
if (response.Url.Contains('API/someEvent'))
{
postData = response.Request.PostData;
}
};
if (isDataValid(postData)) {
return true;
} else {
return false;
}
private Task<bool> isDataValid(){}
Any advice would be very helpful thanks!