SDWebImage提取https图片失败
2016-01-26 09:30
423 查看
今天做项目遇到取不出图片的问题,特别纠结,现解决出来了,给大家一个参考,不用走这么多的弯路,写得不好请大家见谅哈
![](http://static.blog.csdn.net/xheditor/xheditor_emot/default/tongue.gif)
![](http://static.blog.csdn.net/xheditor/xheditor_emot/default/tongue.gif)
![](http://static.blog.csdn.net/xheditor/xheditor_emot/default/tongue.gif)
原因:因为sdwebimage
为了确保图片 设置了accept 类型 限制了接收图片类型。但是https 传进来的图片不符合设置的接收类型 所以会默认成无法显示数据类型。code error 406 !从而导致不能接收图片 。
解决方法:需要将accpet
类型 设置为空,即所有类型都数据都会接收 。在appdelegate中添加下面一行代码就可以了
[[SDWebImageManager sharedManager].imageDownloader setValue: nil forHTTPHeaderField:@"Accept"];
![](http://static.blog.csdn.net/xheditor/xheditor_emot/default/tongue.gif)
![](http://static.blog.csdn.net/xheditor/xheditor_emot/default/tongue.gif)
![](http://static.blog.csdn.net/xheditor/xheditor_emot/default/tongue.gif)
原因:因为sdwebimage
为了确保图片 设置了accept 类型 限制了接收图片类型。但是https 传进来的图片不符合设置的接收类型 所以会默认成无法显示数据类型。code error 406 !从而导致不能接收图片 。
解决方法:需要将accpet
类型 设置为空,即所有类型都数据都会接收 。在appdelegate中添加下面一行代码就可以了
[[SDWebImageManager sharedManager].imageDownloader setValue: nil forHTTPHeaderField:@"Accept"];
相关文章推荐
- HTTPS站点搭建教程:Win7/Windows Server 2008R2
- 【JAVA】Spring HTTP Invoker 远程服务调用
- java模拟从http上下载文件
- 网络丢包严重的解决办法
- 网络流(dinic)
- 升级 TCP 协议将使网速提升30%,中国受益尤为明显
- 运维小知识之nginx---..nginx-sticky-module-1.1ngx_http_sticky_misc.cIn function ‘ngx_http_sticky_misc_text_
- AsyncTask异步任务学习笔记(一、异步任务加载网络图片(多图))
- AngualrJS中每次$http请求时的一个遮罩层Directive
- Android 发送http请求实例
- LAMP环境由http转到https
- 解决android 6.0(api 23) SDK,不再提供org.apache.http.*
- TCP UDP HTTP
- 网络字节序和本地字节序的理解和实现
- SIM808 执行HTTP POST 例程【全网首发】
- TCP连接——爱的传声筒
- TCP/IP协议详解——邮差与邮局
- 图解TCP-IP协议
- HTTP协议是什么
- Win7+VMware Workstation环境下的CentOS-Linux网络连接设置