Skip to content

Instantly share code, notes, and snippets.

@PreSoichiSumi
Last active June 13, 2017 23:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PreSoichiSumi/2a220d19161b2abb406482ce057938a3 to your computer and use it in GitHub Desktop.
Save PreSoichiSumi/2a220d19161b2abb406482ce057938a3 to your computer and use it in GitHub Desktop.
var req = require('request');
var options={
method: 'GET',
uri: 'https://gist.githubusercontent.com/SoichiSumi/5bed3eb79ae8ec97b193f3ca35841990/raw/6d4beeb68822cd9d6af4a164bbfaeab3a9c050a9/test.json',
headers: {
'Origin':'https://github.com/',
'Referer':'https://github.com/SoichiSumi/SoichiSumi.github.io'
}
};
req(options,function(e,res,body){
console.log('response: ',JSON.stringify(res));
console.log('response: ', body);
var jso=JSON.parse(body);
console.log('response:',jso.unko);
console.log('response:',jso["unko"]);
console.log('response:',jso.hoge);
});
@PreSoichiSumi
Copy link
Author

result

....0a9/test.json"},"method":"GET","headers":{"Origin":"https://github.com/","Referer":"https://github.com/SoichiSumi/SoichiSumi.github.io"}}}
response: {
"unko":"one",
"tabindent":"guilty",
"hoge":"2"
}
response: one
response: one
response: 2

@PreSoichiSumi
Copy link
Author

☓ unkoとか書かない

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment