WSDelete

In order to remove an existing resource, you set the WSDelete attribute.

Syntax

WSDelete

Usage

You use this attribute to specify the action of the HTTP verb DELETE to delete a resource. You set the WSDelete attribute in the ATTRIBUTES() clause of the function.

Example using WSDelete to delete a resource

PUBLIC FUNCTION deleteUserProfile(
    id STRING ATTRIBUTE(WSParam) )
  ATTRIBUTES (WSDelete,
              WSPath="/users/{id}",
              WSDescription='Deletes A user profile',
              WSThrows='404:user not found')
  RETURNS STRING
    DEFINE ret  STRING
    # ... function code  ...
    LET ret = SFMT("Deleted user with ID: %1",id)
    RETURN ret
END FUNCTION
In this example the resource specified in the URL
http://host:port/gas/ws/r/xcf/users/xxx
is deleted. xxx is the user id replaced in the 4GL function.