Giter Club home page Giter Club logo

Comments (5)

dgraham avatar dgraham commented on August 15, 2024

Setting headers on the GET request works the same as for POST. There's an example in the README.

Serializing query parameter values can be done with window.encodeURIComponent() or jQuery's $.param().

from fetch.

tiye avatar tiye commented on August 15, 2024

Thanks for pointing out anyway.

from fetch.

pke avatar pke commented on August 15, 2024

This seems not to work in the current version.

fetch(`https://server.com/api/cities.json`, {
      method: "get",
      mode: 'no-cors',
      headers: {
        'X-API-Key': '`XXXXX',
        'Accept-Version': 'v2'
      }
    })

The headers are not set (in Chrome 48.0.2564.109).

from fetch.

mislav avatar mislav commented on August 15, 2024

@pke I'm sorry you're having problems. If fetch() doesn't work for you in Chrome, you should report it to the Chromium issue tracker, since the bug would be with their native implementation. Our polyfill only takes effect in other browsers like Safari and IE which don't implement native window.fetch yet.

from fetch.

pke avatar pke commented on August 15, 2024

I have reported the bug to Chromium

from fetch.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.