Skip to content

fetch res.json() SyntaxError: Unexpected token  in JSON at position 0 #26523

Closed
@YanYuanFE

Description

@YanYuanFE

React Native version: 0.60.5 and 0.59.3

Steps To Reproduce

  1. use fetch report error but worked on browser

Describe what you expected to happen:
res.json() work.

Snack, code example, screenshot, or link to a repository:

fetch('http://minisite.medtoday.com.cn/cycle/v-tipr-physician/getcolumnbycompanyid.php?company_id=1&parent_id=0').then(res => res.json())
    .then(res => {
      console.log(res);
    })

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugStaleThere has been a lack of activity on this issue and it may be closed soon.🌐NetworkingRelated to a networking API.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions