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

what's wrong with this ? what should I do ? #41

Closed
xgqfrms-GitHub opened this issue Nov 3, 2016 · 3 comments
Closed

what's wrong with this ? what should I do ? #41

xgqfrms-GitHub opened this issue Nov 3, 2016 · 3 comments

Comments

@xgqfrms-GitHub
Copy link

xgqfrms-GitHub commented Nov 3, 2016

Run this code in a console or from anywhere (CORS and JSONP supported).

smg

var root = 'http://jsonplaceholder.typicode.com';
$.ajax({
    url: root + '/posts/1',
    method: 'GET'
}).then(function(data) {
    console.log(data);
});

jquery-ajax -error

@typicode
Copy link
Owner

typicode commented Nov 3, 2016

Hi @xgqfrms-GitHub,

Sorry for the confusion, it should be run in the browser console when you are on http://jsonplaceholder.typicode.com/ or any page that has jQuery loaded.

screenshot

If you want to make a request with Node, you can use request or got.

Hope this helps :)

@xgqfrms-GitHub
Copy link
Author

xgqfrms-GitHub commented Nov 3, 2016

Anyway, thanks for you reply!

I was just using CURL & webStrom test REST web server to make it!

@typicode
Copy link
Owner

typicode commented Nov 3, 2016

there's a great tutorial on egghead.io if you need more:
https://egghead.io/lessons/nodejs-creating-demo-apis-with-json-server

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

2 participants