2017-06-15 148 views
0

我连接到URL,它做在5分钟左右的东西,同时这是不可能连接到这个网站,因为HTTP请求使用同一地址连接到URL阻塞网络连接

我跑了沟通python代码由ajax - 在java脚本中。

Java脚本代码: VAR结构= { $:jQuery.noConflict(),

ExecuteUpdateData: function() { 
    var $ = this.$, 
     me = this; 
    $.ajax({ 
     type: 'POST', 
     url: '/ExecuteUpdateData/', 
    }).done(function (result) { 
     if (result != "Succeeded") 
      alert('Failed to update data, the error message: ' + result) 
     $("#update_data").attr("class", "update_data_on"); 
    }); 
} 

} Python代码: DEF的UpdateData(A): 打印 '更新数据'

res = False 
global_server = 'http://10.184.197.149:8055' 

try: 
    response = urllib2.urlopen(global_server) 
    url_res = response.read() 
except Exception, e: 
    print(e) 
    return HttpResponse(e.message) 

return HttpResponse(url_res.strip()) 

回答

0

该问题是由URL中打开的C#代码中的“任务”引起的