搜索
aardio官方社区 门户 查看主题

请教一个疑惑问题

发布者: hrong | 发布时间: 2018-3-2 15:42| 查看数: 979| 评论数: 3|帖子模式

本帖最后由 hrong 于 2018-3-2 15:45 编辑

import win.ui;
/*DSG{{*/
mainForm = win.form(text="aardio form";right=841;bottom=337)
mainForm.add(
button={cls="button";text="button";left=51;top=222;right=158;bottom=273;z=3};
button2={cls="button";text="button2";left=170;top=224;right=271;bottom=274;z=5};
edit={cls="edit";text="132693736161";left=82;top=34;right=322;bottom=94;edge=1;multiline=1;z=1};
edit2={cls="edit";text="491005850";left=82;top=111;right=321;bottom=172;edge=1;multiline=1;z=2};
edit3={cls="edit";text="edit3";left=385;top=26;right=827;bottom=317;edge=1;multiline=1;z=4}
)
/*}}*/

import web.json;
import inet.whttp;
var t;
var http=inet.whttp();
mainForm.button2.oncommand = function(id,event){
    var htthead=/*
GET /feed/city/0 HTTP/1.1
Extrainfo: offical
timezone: Asia/Shanghai
Authorization: Token 1519971843-scHpQKGx5Wi7iXsz-15936322
X-Same-Request-ID: 34686a55-552c-40db-abf7-0d98d6ef5b62
Machine: android|301|android4.4.2|vivo Y18L|d:86518124772|1280|720
PACKAGE-NAME: com.same.android
Host: v2.same.com
User-Agent: same/594
X-same-Device-UUID: d:86518124772
Advertising-UUID: d:86518124772
X-same-Client-Version: 594
Connection: keep-alive
*/
var hr = http.get("https://115.159.131.165/feed/city/0",htthead,,);
mainForm.edit3.text=hr
}

mainForm.enableDpiScaling();
mainForm.show();

return win.loopMessage();


这个相同的操作,用其他的语言写是可以取到内容的,但用这个取得却是空值,请问这个问题出在哪里?

最新评论

Smirk丶 发表于 2018-3-2 17:35:51
var hr = http.get("https://115.159.131.165/feed/city/0",htthead,,);
mainForm.edit3.text=hr

改成

var hr,html = http.get("https://115.159.131.165/feed/city/0",htthead,,);
mainForm.edit3.text=html


Smirk丶 发表于 2018-3-2 17:46:52
import win.ui;
/*DSG{{*/
mainForm = win.form(text="aardio form";right=841;bottom=337)
mainForm.add(
button={cls="button";text="button";left=51;top=222;right=158;bottom=273;z=3};
button2={cls="button";text="button2";left=170;top=224;right=271;bottom=274;z=5};
edit={cls="edit";text="132693736161";left=82;top=34;right=322;bottom=94;edge=1;multiline=1;z=1};
edit2={cls="edit";text="491005850";left=82;top=111;right=321;bottom=172;edge=1;multiline=1;z=2};
edit3={cls="edit";text="edit3";left=385;top=26;right=827;bottom=317;edge=1;multiline=1;z=4}
)
/*}}*/

import web.json;
import inet.whttp;
var t;
var http=inet.whttp();
mainForm.button2.oncommand = function(id,event){
    var htthead=/*
Extrainfo: offical

timezone: Asia/Shanghai
Authorization: Token 1519971843-scHpQKGx5Wi7iXsz-15936322
X-Same-Request-ID: 34686a55-552c-40db-abf7-0d98d6ef5b62
Machine: android|301|android4.4.2|vivo Y18L|d:86518124772|1280|720
PACKAGE-NAME: com.same.android
Host: v2.same.com
User-Agent: same/594
X-same-Device-UUID: d:86518124772
Advertising-UUID: d:86518124772
X-same-Client-Version: 594
Connection: keep-alive
*/
var hr,html = http.get("http://115.159.131.165/feed/city/0",htthead,,);

mainForm.edit3.text=html


}

mainForm.enableDpiScaling();
mainForm.show();

return win.loopMessage();

应该这样 你的head也有错
Jacen.He 发表于 2018-3-2 19:03:39
你用的其他语言是什么语言,服务器报错了你都不知道?!
如果 http.get 执行失败,使用 http.statusCode 看服务器错误代码,你这里是403错误。

403错误,想查看服务端返回的json,使用 http.lastResponse() 获取。
就是用其他语言你也要先看函数文档才开写吧?!

手机版|未经许可严禁引用或转载本站文章|站长邮箱|aardio.com|aardio官方社区 ( 皖ICP备09012014号 )

GMT+8, 2018-7-21 09:41 , Processed in 0.046875 second(s), 18 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表