http://www.sufeinet.com/plugin.php?id=keke_group

苏飞论坛

 找回密码
 马上注册

QQ登录

只需一步,快速开始

分布式系统框架(V2.0) 轻松承载百亿数据,千万流量!讨论专区 - 源码下载 - 官方教程

HttpHelper爬虫框架(V2.7-含.netcore) HttpHelper官方出品,爬虫框架讨论区 - 源码下载 - 在线测试和代码生成

HttpHelper爬虫类(V2.0) 开源的爬虫类,支持多种模式和属性 源码 - 代码生成器 - 讨论区 - 教程- 例子

查看: 3515|回复: 5

[源码分享] post 异常

[复制链接]
发表于 2016-6-29 16:36:15 | 显示全部楼层 |阅读模式
YFPZ1ZSW_ONHQS_$_FD5VMW.jpg   post的时候异常错误,帮忙看看 谢谢。


1. 开通SVIP会员,免费下载本站所有源码,不限次数据,不限时间
2. 加官方QQ群,加官方微信群获取更多资源和帮助
3. 找站长苏飞做网站、商城、CRM、小程序、App、爬虫相关、项目外包等点这里
发表于 2016-6-29 16:49:07 | 显示全部楼层
这截图只堆栈信息没有错误信息啊,截图全面一点,或者直接把代码贴上来,错误代码
 楼主| 发表于 2016-6-29 16:50:36 | 显示全部楼层
站长苏飞 发表于 2016-6-29 16:49
这截图只堆栈信息没有错误信息啊,截图全面一点,或者直接把代码贴上来,错误代码

System.IO.InvalidDataException: The magic number in GZip header is not correct. Make sure you are passing in a GZip stream.
   at System.IO.Compression.GZipDecoder.ReadHeader(InputBuffer input)
   at System.IO.Compression.Inflater.Decode()
   at System.IO.Compression.Inflater.Inflate(Byte[] bytes, Int32 offset, Int32 length)
   at System.IO.Compression.DeflateStream.Read(Byte[] array, Int32 offset, Int32 count)
   at System.IO.Compression.GZipStream.Read(Byte[] array, Int32 offset, Int32 count)
   at System.IO.Stream.InternalCopyTo(Stream destination, Int32 bufferSize)
   at System.IO.Stream.CopyTo(Stream destination, Int32 bufferSize)
   at CsharpHttpHelper.Base.HttphelperBase.GetByte()
   at CsharpHttpHelper.Base.HttphelperBase.GetData(HttpItem item, HttpResult result)
   at CsharpHttpHelper.Base.HttphelperBase.GetHtml(HttpItem item)
   at CsharpHttpHelper.BaseBll.HttpHelperBll.GetHtml(HttpItem item)
   at CsharpHttpHelper.HttpHelper.GetHtml(HttpItem item)
   at WindowsFormsApplication1.Form1.dl()
发表于 2016-6-29 16:52:29 | 显示全部楼层
代码没有经过GZIP压缩,而你们直接使用了GZIP,贴一下你的代码看看,Item类怎么配置的参数
 楼主| 发表于 2016-6-29 17:00:25 | 显示全部楼层
站长苏飞 发表于 2016-6-29 16:52
代码没有经过GZIP压缩,而你们直接使用了GZIP,贴一下你的代码看看,Item类怎么配置的参数

item = new HttpItem()
                {
                    URL = "http://i.sdo.com/accInfo?sndaid="+a.data.sndaId+"&cache=0&_=1467125130030",
                    Cookie = cookie,
                    Host = "i.sdo.com",
                    Referer= "http://i.sdo.com/#routeto=info",
                    Accept = "application/json, text/javascript, */*; q=0.01",
                    ContentType = "application/json;charset=utf-8",
                    ProxyIp = Ip,
                    Expect100Continue = false,
                };
                item.Header.Add("X-Requested-With", "XMLHttpRequest");
                result = http.GetHtml(item);
发表于 2016-6-29 18:37:56 | 显示全部楼层
你使用的代理IP,看代码没有问题,你把代理IP去掉看看会不会有问题
您需要登录后才可以回帖 登录 | 马上注册

本版积分规则

QQ|手机版|小黑屋|手机版|联系我们|关于我们|广告合作|苏飞论坛 ( 豫ICP备18043678号-2)

GMT+8, 2024-3-29 13:39

© 2014-2021

快速回复 返回顶部 返回列表