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

CORS #2

Open
xyzdata opened this issue Aug 3, 2017 · 1 comment
Open

CORS #2

xyzdata opened this issue Aug 3, 2017 · 1 comment

Comments

@xyzdata
Copy link
Contributor

xyzdata commented Aug 3, 2017

CORS

https://github.com/xyz-data/json/blob/master/cors.js

fetch('https://newsapi.org/v1/articles?source=the-next-web&sortBy=latest',{
    method: 'get',
    headers: {
        'Accept': 'application/json',
        'Content-Type': 'application/json',
        'X-Api-Key': `0987b00e542141369049e647701b65d9`
    }
})
.then(function(response) {
    return response.json()
}).then(function(json) {
    console.log('parsed json: ', json)
}).catch(function(error) {
    console.log('parsing failed: ', error)
});


// https://gist.github.com/xgqfrms-GitHub/a3fcffb6d7923e2a7471041053f00162
@xyz-data xyz-data locked and limited conversation to collaborators Aug 3, 2017
@xyzdata
Copy link
Contributor Author

xyzdata commented Aug 3, 2017

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

No branches or pull requests

1 participant