admin管理员组文章数量:1419905
I am trying to delete a media object from my Wordpress instance using the Wordpress API in Postman.
I'm having trouble finding the endpoint according to the documentation.
Here is my http method and route:
DELETE {{site}}/wp-json/wp/v2/media/{{mediaId}}?force=1
I keep getting route not found however:
{
"code": "rest_no_route",
"message": "No route was found matching the URL and request method",
"data": {
"status": 404
}
}
This is how I'm trying to call it generated in curl:
curl -X DELETE \
http://<site>/<subsite>/wp-json/wp/v2/media/?force=1 \
-H 'Accept: */*' \
-H 'Accept-Encoding: gzip, deflate' \
-H 'Authorization: Basic <token>' \
-H 'Cache-Control: no-cache' \
-H 'Connection: keep-alive' \
-H 'Content-Length: ' \
-H 'Host: <Host IP>' \
-H 'Postman-Token: <Postman-Token>' \
-H 'User-Agent: PostmanRuntime/7.15.2' \
-H 'cache-control: no-cache' \
Following the documentation for the delete endpoint.
/
本文标签: Deleting media using the Wordpress Rest API
版权声明:本文标题:Deleting media using the Wordpress Rest API 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745298008a2652194.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论