JSON Parse error: Unrecognized token'<' - react-native

前端 未结 10 1640
执笔经年
执笔经年 2020-12-09 11:21

\"JSON Parse error: Unrecognized token\'<\'\" Error is showing while hitting the api. Code is attached below Note* : Response is in the JSON format.

10条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-09 12:01

    In my case, I was using Infinity Free WebHosting for my API design and tests and apparently they dont allow exposure of API endpoints if you are using their free account.

    That error means you are getting HTML code sent back to you and you have to do a console.log(data_response) to see the actual error. It is much easier if you are using Axios

    Error that i was getting:

    
    

    Solution:

    Try another different Shared Hosting service provider.

提交回复
热议问题