Skip to content
This repository was archived by the owner on Mar 16, 2019. It is now read-only.
This repository was archived by the owner on Mar 16, 2019. It is now read-only.

polyfill.Fetch object request body (application/json ) being converted to string #160

Closed
@mikemonteith

Description

@mikemonteith

It seems that fetch() calls with a JSON body, the JSON is being converted to a string.

This is the whatwg-fetch way of doing a JSON post:

fetch(URL, {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({abc: 123}),
});

I have also tried

fetch(URL, {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
  },
  body: {abc: 123},
});

I think that polyfill.Fetch is converting my JSON-string into a string-containing-a-JSON-string.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions