output json object from python to javascript -
(new python) writing simple python function, outputting json javascript get.
when run python script on command line, output json object
print json.dumps(data)
on js,
this.$http.get(link_to_python_script).then(function(response){ console.log('data',response.data); }, function(error){ console.log('http error',error.statustext); });
when examine response on browser has header:
content-type:text/plain; charset=utf-8
and in browser console.log prints out entire python script instead of json object. keep simple , not using addons. how can accomplish this?
Comments
Post a Comment