Angular 2 SyntaxError: Unexpected token < in>)

前端 未结 2 1501
长情又很酷
长情又很酷 2021-01-13 07:44

I am calling the web API from my Angular2 Component service in Visual Studio, but continuously I am getting the error \"Unexpected token < in JSON at position 0 at JS

2条回答
  •  执笔经年
    2021-01-13 08:09

    The headers are not useful, the data would be. But the error message is clear: What you think is supposed to be JSON, starts with a "<" as the first character, and JSON doesn't ever start with a "<". Most likely you are receiving either html or xml.

提交回复
热议问题