Usage

DELETE(url, contentType)
DELETE(url)

Description
Sends an HTTP DELETE request with an optional content type to the given url. This method can be used to make HTTP requests from within the Structr Server, triggered by a frontend control like a button etc.

The DELETE() method will return a response object with the following structure:

FieldDescriptionType
statusHTTP status of the requestInteger
headersResponse headersMap
bodyResponse bodyMap or String

Note
Please note that the DELETE() method will not be executed in the security context of the current user. The request will be made by the Structr server, without any user authentication or additional information. If you want to access external protected resources, you will need to authenticate the request using add_header(). (see the related articles for more information)

Example

${DELETE('http://localhost:8082/structr/rest/User/6aa10d68569d45beb384b42a1fc78c50')}

results in

{body={code=401.0, message=Forbidden}, status=401, headers={Date=Tue, 22 Dec 2015 16:39:20 GMT, Content-Type=application/json; charset=utf-8, Content-Length=44, Server=Jetty(9.2.9.v20150224)}}

Graph-Browser

Related Articles
About this article
Last change 2018-01-30
Topics