我正在使用 Parse.com 的 httpRequest 来检索网站的源代码。
代码:
Parse.Cloud.define("extract_website_simple", function(request, response)
{
return Parse.Cloud.httpRequest({url: 'http://bet.hkjc.com/marksix/index.aspx?lang=en' }).then
(function(httpResponse)
{
response.success("code=" + httpResponse.text);
},
function (error)
{
response.error("Error: " + error.code + " " + error.message);
});
});
问题:
无法检索 html 代码。而是在加载10秒后出现了ParseException,写法如下:
com.parse.ParseException: i/o failure: java.net.SocketTimeoutException: Read timed out
我怎样才能在没有超时的情况下正确检索它?似乎没有办法增加超时长度?
谢谢!