我在haxe/php中使用Lib.print(string);打印了一个json字符串,并将其托管在本地主机上。
我检查了,它确实将json对象打印为文本。
我的HTML5应用程序中有以下代码
var h = new HttpJs('http://localhost/index.php');
function traceFunc (d:String){trace(d); }
h.onData = traceFunc;
h.onError = traceFunc;
这还没有得到一个onData响应(或onError响应)。我知道我一定错过了一些简单的事情。
我有如下所示的代码,其中我已经调度从php web服务器页面获得http响应。
public static void stopPHPDataChecker() {
canStop=true;
}
public static void main (String args[]) {
// http request to the php page and get the response
PHPDataChecker pdc = new PHPDataChecker();
ScheduledExecutorService scheduler =
这里我有一个小问题,我想从我的节点服务器向PHP服务器提出一个请求。我已经这样做了
request('http://services.qlue.id/external/crop_generate_data.php', function (error, response, body) {
console.log(response);
result += response;
});
但是我只想把这个响应放到类似这样的新响应中
var result = '';
request('http://foo.bar.co