New in version 6.1.0: See the new features.

Returns the HTTP method or verbΒΆ

get_web_method()

Returns the HTTP method or verb

SYNTAX

get_web_method()

This method is only available in nph-srep.

Returns the HTTP method (or verb) that caused the nph-srep call. Possible values (defined in $SCULPTOR/include/www.h):

!define NO_METHOD       0
!define METHOD_POST     1
!define METHOD_GET      2
!define METHOD_HEAD     3
!define METHOD_TRACE    4
!define METHOD_OPTIONS  5
!define METHOD_PUT      6
!define METHOD_DELETE   7

EXAMPLE

This nph-srep example checks if the http verb is DELETE:

/* Check the correct delete method */
if (get_web_method() <> METHOD_DELETE) {
    web_status(405, "METHOD NOT SUPPORTED")
    put "Request method not supported by that resource"
    end
}

RELATED TOPICS

Creating web pages with Sculptor

Internet functions