question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Fetch adds charset=utf-8 on Android but not on iOS

See original GitHub issue

This fetch request sends “application/json” as ContentType on IOS but “application/json; charset=utf-8” on Android:

fetch(url, {
    method: 'POST',
    headers: {
        'Accept': 'application/json',
        'Content-Type': 'application/json',
    }
})

The server I’m working against requires application/json and fails when charset is added. I’ve filed a bug report with them too, but shouldn’t fetch behave identically on ios and android?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:15
  • Comments:38 (4 by maintainers)

github_iconTop GitHub Comments

10reactions
programadornatalcommented, Sep 13, 2018

To resolve this problem, use lib axios https://github.com/qiangmao/axios

10reactions
laurent22commented, Feb 7, 2018

Please don’t close, this is still an issue in latest RN

Read more comments on GitHub >

github_iconTop Results From Across the Web

React Native Fetch on Android will not pass options
So I finally figured it out. Android is appending 'charset=utf-8' to the Content-Type. Making it 'Content-Type: 'application/json; ...
Read more >
The Script element - HTML: HyperText Markup Language
This attribute contains inline metadata that a user agent can use to verify that a fetched resource has been delivered free of unexpected ......
Read more >
Google Sign-In for server-side apps | Authentication
Keep your client secret secret! Implementing the one-time-code flow. The Google Sign-In button provides both an access token and an authorization code ...
Read more >
Fetch Standard
At a high level, fetching a resource is a fairly simple operation. A request goes in, a response comes out. The details of...
Read more >
Email Encoding: Setting Content-Type and HTML Spcecial ...
You can set your entire email to use UTF-8 character encoding, ... Just paste in your special characters and symbols, hit a button,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found