airesvsg / acf-to-rest-api

Exposes Advanced Custom Fields Endpoints in the WordPress REST API
https://wordpress.org/plugins/acf-to-rest-api/
1.33k stars 111 forks source link

Support for http DELETE #269

Open apandichi opened 6 years ago

apandichi commented 6 years ago

I'm trying to delete ACF data by issuing a DELETE http request:

http DELETE http://localhost/wp-json/acf/v3/sessions/4993

The response is:

HTTP/1.1 404 Not Found
Access-Control-Allow-Headers: Authorization, Content-Type
Access-Control-Expose-Headers: X-WP-Total, X-WP-TotalPages
Connection: keep-alive
Content-Type: application/json; charset=UTF-8
Date: Thu, 13 Sep 2018 14:18:44 GMT
Link: <http://localhost/wp-json/>; rel="https://api.w.org/"
Server: nginx/1.10.3 (Ubuntu)
Transfer-Encoding: chunked
X-Content-Type-Options: nosniff
X-Powered-By: PHP/5.6.33-1+ubuntu16.04.1+deb.sury.org+1
X-Robots-Tag: noindex

{
    "code": "rest_no_route", 
    "data": {
        "status": 404
    }, 
    "message": "No route was found matching the URL and request method"
}

Issuing a GET request on that same URL returns HTTP/1.1 200 OK, including all the expected ACF data in the response.