📄 http_service.he
字号:
class
{
const String URL = "http://www.google.com/search";
void startWidget()
{
setMinimizedView(createMinimizedView("viewMini", getStyle("default")));
}
Shell openWidget()
{
fetch();
return null;
}
void fetch()
{
//http parameters to be used in get-query
Value params = [
"q" => "widsets",
"meta" => ""
];
//widsets http service parameters
Value arg = [
"url" => URL,
"params" => params
];
call(null, "httpService", "get", arg, ok, nok);
}
void ok(Object state, Value ret)
{
setBubble(null, "Got "+ret.size()+" bytes of html");
//printing html to log
printf(ret);
}
void nok(Object state, String error)
{
setBubble(null, "Http get failed: "+error);
}
} //class
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -