# Adding \`delete\` as HTTP method for http\_json\_read\_data

**URL:** <https://swi-prolog.discourse.group/t/adding-delete-as-http-method-for-http-json-read-data/6555>\
**Category:** General\
**Created:** [May 17, 2023, 4:31pm UTC](https://swi-prolog.discourse.group/t/adding-delete-as-http-method-for-http-json-read-data/6555 "2023-05-17T16:31:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![EricGT](https://avatars.discourse-cdn.com/v4/letter/e/f1d935/32.png) [@EricGT](https://swi-prolog.discourse.group/u/EricGT)\
**Post date:** [May 17, 2023, 4:31pm UTC](https://swi-prolog.discourse.group/t/adding-delete-as-http-method-for-http-json-read-data/6555/1 "2023-05-17T16:31:20Z")

</div>

Currently http\_read\_json/2,3 and http\_read\_json\_dict/2,3 does not allow for `delete` as a valid HTTP method,

> <https://github.com/SWI-Prolog/packages-http/blob/3040c654f8f8f889084818e6359b8b01340bba4e/http_json.pl#L284-L299>

The documentation notes

> - `domain_error(method, Method)` if the request method is not a `POST` , `PUT` or `PATCH` .

Can `delete` be added for the predicate data\_method/1?

* * *

For a 3rd party API where delete would be useful

[https://petstore3.swagger.io/](https://petstore3.swagger.io/)

* * *

**EDIT** May 19, 2023

May not need this if [SWI-Prolog OpenAPI (Swagger) interface](https://github.com/JanWielemaker/openapi) works.
