php http 工具类,Http 工具类 解析数据问题

论坛 期权论坛 编程之家     
选择匿名的用户   2021-5-28 20:29   198   0

int id = 622;

String url = "http://www.allcast.is/stream.php?id=" + id + "&width=100%&height=100%&stretching=uniform";

Response response = Http.post3(url, null, Header.create().set("Referer", "http://showsport-tv.com/embedplayer.php?ch=bein1&server=1").set("content-encoding", "gzip"), 6000);

if (response.isOK()) {

String content = response.getContent();

System.out.println(content);

控制台错误

Exception in thread "main" java.lang.RuntimeException: java.util.zip.ZipException: Corrupt GZIP trailer

at org.nutz.lang.Lang.wrapThrow(Lang.java:184)

at org.nutz.lang.Streams.readAndClose(Streams.java:293)

at org.nutz.http.Response.getContent(Response.java:150)

at org.nutz.http.Response.getContent(Response.java:143)

at com.anawin.hls.Beins.main(Beins.java:15)

Caused by: java.util.zip.ZipException: Corrupt GZIP trailer

at java.util.zip.GZIPInputStream.readTrailer(GZIPInputStream.java:225)

at java.util.zip.GZIPInputStream.read(GZIPInputStream.java:119)

at java.io.BufferedInputStream.fill(BufferedInputStream.java:246)

at java.io.BufferedInputStream.read1(BufferedInputStream.java:286)

at java.io.BufferedInputStream.read(BufferedInputStream.java:345)

at java.io.BufferedInputStream.read1(BufferedInputStream.java:284)

at java.io.BufferedInputStream.read(BufferedInputStream.java:345)

at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:284)

at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:326)

at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:178)

at java.io.InputStreamReader.read(InputStreamReader.java:184)

at java.io.Reader.read(Reader.java:140)

at org.nutz.lang.Streams.read(Streams.java:316)

at org.nutz.lang.Streams.read(Streams.java:274)

at org.nutz.lang.Streams.readAndClose(Streams.java:290)

... 3 more

分享到 :
0 人收藏
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

积分:3875789
帖子:775174
精华:0
期权论坛 期权论坛
发布
内容

下载期权论坛手机APP