likepoems
发布于 2023-06-10 / 1 阅读
0
0

新浪图片403解决办法

1、403 Forbidden

403通常表示没有权限访问某个资源,当资源来源开启了防盗链后,只有白名单下的来源才能访问。

2、解决方案

使用图片缓存服务:

i0/1/2/3.wp.com
cdn.cdnjson.com
https://image.baidu.com/search/down?url=

使用方式:
比如请求新浪图片https://tvax3.sinaimg.cn/large/a15b4afegy1fmvj9449p8j21hc0u0wqg.jpg
可以直接使用:
https://i3.wp.com/tvax3.sinaimg.cn/large/a15b4afegy1fmvj9449p8j21hc0u0wqg.jpg
https://cdn.cdnjson.com/tvax3.sinaimg.cn/large/a15b4afegy1fmvj9449p8j21hc0u0wqg.jpg
https://image.baidu.com/search/down?url=https://tvax3.sinaimg.cn/large/a15b4afegy1fmvj9449p8j21hc0u0wqg.jpg

评论