尝试使用Google AppScript UrlFetchApp获取分块内容:
@Entity(value = "productDils", noClassnameStored = true)
@Indexes(
{@Index(fields = {}, options = @IndexOptions(expireAfterSeconds = 36)),
@Index(fields = {@Field("pid")}, options = @IndexOptions(unique = true))
}
)
public class ProductDils {}
不幸的是,它不能很好地处理它,并且在第一个块或之间的某个位置之后停止。
这是HTTP响应标头:
UrlFetchApp.fetch(url, {muteHttpExceptions:true});
HTTP/1.1 200 OK
access-control-allow-credentials: true
access-control-allow-origin: *
access-control-expose-headers:
cache-control: max-age=0, private, must-revalidate
content-type: application/json; charset=utf-8
date: Fri, 26 Oct 2018 11:15:24 GMT
x-request-id: 2lgi8mvh6onm5jrvf8000tl1
transfer-encoding: chunked
Connection: keep-alive
甚至支持分块响应吗?如果没有,还有其他选择吗?