How to resolve “TypeError: NetworkError when attempting to fetch resource.”

前端 未结 3 1064
小鲜肉
小鲜肉 2021-01-04 13:25

When I use aurelia-fetch-client to post json data to server and I got this error \"TypeError: NetworkError when attempting to fetch resource.\" I think your answer is very u

3条回答
  •  有刺的猬
    2021-01-04 14:04

    It was a CORS problem in my case, POST request was blocked because server didn't list all needed headers in the allowed headers request header. Setting 'Access-Control-Allow-Headers' to '*' on server did the trick.

提交回复
热议问题