Reading response headers when using $http of Angularjs

后端 未结 2 1467
悲&欢浪女
悲&欢浪女 2020-11-27 15:51

I am using $http to make an api call which is sending some custom header like X-Foo. However I can\'t yet figure out how to read them. Inside the <

2条回答
  •  鱼传尺愫
    2020-11-27 16:05

    The custom headers will be visible in same domain. However, for the crossdomain situation, the server has to send Access-Control-Expose-Headers: X-Foo, ... header to make the custom headers visible.

提交回复
热议问题