大佬教程收集整理的这篇文章主要介绍了Wordpress 401 错误:rest_forbidden。抱歉,您不能进行代理 oEmbed 请求,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我在 windows IIS 服务器上托管的 wordpress 上执行以下 URL 调用时收到 401 错误:
https://example.com/wp-json/oembed/1.0/proxy?url=https://example.com/wp-content/uploads/img.jpg
{
"code": "rest_forbIDden","message": "Sorry,you are not allowed to make proxIEd oEmbed requests.","data": {
"status": 401
}
}
当我想为其设置外部图像时,上面的 URL 由 Elementor 画廊小部件调用。
虽然,以下 URL 在我的 wordpress 网站上有效:
https://example.com/wp-json/oembed/1.0?url=https://example.com/wp-content/uploads/img.jpg
{
"namespace": "oembed\/1.0","routes": {
"\/oembed\/1.0": {
"namespace": "oembed\/1.0","methods": ["GET"],"endpoints": [{
"methods": ["GET"],"args": {
"namespace": {
"default": "oembed\/1.0","required": false
},"context": {
"default": "vIEw","required": false
}
}
}
],"_links": {
"self": [{
"href": "https:\/\/example.com\/wp-Json\/oembed\/1.0"
}
]
}
},"\/oembed\/1.0\/embed": {
"namespace": "oembed\/1.0","args": {
"url": {
"description": "The URL of the resource for which to fetch oEmbed data.","type": "String","format": "uri","required": true
},"format": {
"default": "Json","maxwIDth": {
"default": 600,"_links": {
"self": [{
"href": "https:\/\/example.com\/wp-Json\/oembed\/1.0\/embed"
}
]
}
},"\/oembed\/1.0\/proxy": {
"namespace": "oembed\/1.0","format": {
"description": "The oEmbed format to use.","default": "Json","enum": ["Json","xml"],"maxwIDth": {
"description": "The maximum wIDth of the embed frame in pixels.","type": "Integer","default": 600,"maxheight": {
"description": "The maximum height of the embed frame in pixels.","discover": {
"description": "Whether to perform an oEmbed discovery request for unsanctioned provIDers.","type": "Boolean","default": true,"_links": {
"self": [{
"href": "https:\/\/example.com\/wp-Json\/oembed\/1.0\/proxy"
}
]
}
}
},"_links": {
"up": [{
"href": "https:\/\/example.com\/wp-Json\/"
}
]
}
}
php:7.4.16 wordpress:5.6.2 windows 服务器:2019
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)
以上是大佬教程为你收集整理的Wordpress 401 错误:rest_forbidden。抱歉,您不能进行代理 oEmbed 请求全部内容,希望文章能够帮你解决Wordpress 401 错误:rest_forbidden。抱歉,您不能进行代理 oEmbed 请求所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。