LoginSignup
10
11

More than 5 years have passed since last update.

[pepper]pythonのrequestで取得したJSONデータをタブレットに丸々渡す。

Posted at

メモです。
python側
import requests
# GET通信
res = requests.get('https://hogehoge.org/fugafuga.json)
data = res.json()
self.memory.raiseEvent("myapp/data", json.dumps(data).encode("utf-8"))

として渡して、受け側Javascriptで、
$.subscribeToALMemoryEvent("myapp/data", function (data) {
data = JSON.parse(data);
console.log(data);
});
で、OK!!

10
11
3

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
10
11