Headers is not defined
See original GitHub issueI instruct Zombie to visit a page which has the following code:
fetch('http://localhost:8000/', {
body: body,
method: 'post',
headers: new Headers({ 'Content-Type': 'text/plain' })
}).then(function (res) {return true; });
Then I get an error that Headers is not defined
, so the script within the simulated headless browser does not continue because it does not recognize Headers
. Do I need to add some option to Zombie so it recognizes the entire standard JS Fetch API?
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
reactjs - 'ReferenceError: Headers is not defined' when using ...
I'm setting up a new application in React and I want it to be server side rendered. Unfortunately I'm not able to use...
Read more >javascript api call - Headers is not defined - LinuxQuestions.org
Any (competent) library which sends HTTP requests has a means to set the headers - you just need to check the docs for...
Read more >ReferenceError: Headers is not defined · Issue #56 - GitHub
When using swiftype-app-search-javascript to do search in an app using coffee script, I got Headers is not defined error.
Read more >Headers is not defined' when using Headers in a server side ...
Coding example for the question 'ReferenceError: Headers is not defined' when using Headers in a server side rendered react project-Reactjs.
Read more >Headers not found - Coding Help - Glitch Support
I use for that the “fetch” JS function with some Headers. My problem is the following : Glitch ... ReferenceError: Headers is not...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You’re running within the context of node, not the browser. You can polyfill the
Headers
class from the browser: https://www.npmjs.com/package/fetch-headersYou’re better off just using a vanilla object though…
I’d be more than happy to submit a PR that adds the polyfills.