Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

query string parameters on GET #189

Closed
AjRoAs opened this issue Oct 14, 2016 · 16 comments
Closed

query string parameters on GET #189

AjRoAs opened this issue Oct 14, 2016 · 16 comments

Comments

@AjRoAs
Copy link

AjRoAs commented Oct 14, 2016

hi, i just read that it's no supported by node-fetch. i'm trying to consume an API that only works with GET so y cannot use the POST body. Any ideas of how to solve this?

@bitinn

This comment has been minimized.

@crosofg

This comment has been minimized.

@crosofg

This comment has been minimized.

@AjRoAs

This comment has been minimized.

@bitinn

This comment has been minimized.

@crosofg

This comment has been minimized.

@bitinn

This comment has been minimized.

@AjRoAs

This comment has been minimized.

@bitinn

This comment has been minimized.

@crosofg

This comment has been minimized.

@AjRoAs

This comment has been minimized.

@AjRoAs AjRoAs closed this as completed Oct 14, 2016
@intellix
Copy link

intellix commented Nov 13, 2016

Was also looking for this as it's possible in the official fetch impl:

https://fetch.spec.whatwg.org/#fetch-blob-example

var url = new URL("https://geo.example.org/api"),
    params = {lat:35.696233, long:139.570431}
Object.keys(params).forEach(key => url.searchParams.append(key, params[key]))
fetch(url).then(/* … */)

Which would save me from doing a cheap parser of my own :)

@TimothyGu

This comment has been minimized.

@charlesbdudley

This comment has been minimized.

@dpilafian

This comment has been minimized.

@jimmywarting
Copy link
Collaborator

jimmywarting commented Aug 10, 2018

@dpilafian

const url = 'https://graph.facebook.com/v2.6/me/messages?'
const params = new URLSearchParams({ access_token: 'PAGE_ACCESS_TOKEN' })
fetch(url + params).then(console.log)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants