如果过于频繁地调用,则无法从web api获取自定义标头值
问题描述:
我从angularjs调用web api服务。我在调用服务之前设置了一些自定义标头。我通过Request.Headers.GetValues获得了价值。它工作正常。
但问题是如果我立即多次服务或多次同时服务,那么我在服务器上获取标头null 。
如果我在服务电话之前使用JavaScript的一些setTimeout然后再次工作正常。
有谁能让我知道我的方法有什么问题?
提前谢谢。
I am calling web api services from angularjs. I am setting some custom header before calling the service. I am getting the value by Request.Headers.GetValues. It is working fine.
But the problem is if I call multiple service immediately or same service multiple time immediately , then I am getting the header null at server.
If I use some setTimeout from JavaScript before service call then again it is working fine.
Can anybody let me know what is wrong with my approach?
Thanks in advance.