我正在尝试使用nodejs和thrift连接到此API http://antares-clinic.ro:8125/medicalpages-api/php/test_api.php,如下所示:
var transport = thrift.TBufferedTransport;
var protocol = thrift.TBinaryProtocol;
var connection = thrift.createConnection("http://antares-clinic.ro",8125,{
transport : transport,
protocol : protocol,
path : "/medicalpages-api/php/test_api.php"
});
但是我收到此错误getaddrinfo ENOTFOUND http://antares-clinic.ro http://antares-clinic.ro:8125
。我知道发生这种情况是因为未设置路径。我该如何解决?
答案 0 :(得分:0)
尝试
var connection = thrift.createConnection("http://antares-clinic.ro/medicalpages-api/php/test_api.php",8125,{
transport : transport,
protocol : protocol
});