如何等待并获得.net剧作家中的最后一个回应
请帮助我解决这个问题。我有需要获得同一API调用的最后一个响应的情况,但这是异步调用,我不知道该如何处理。问题在于,我可以对相同的“ API/SOMEEVENT”提出多个请求,但是我只需要验证最后一个的响应数据。
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(){}
任何建议都会非常有帮助!
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!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论