Introduced in SQLPage 0.21.0.
Returns the HTTP request method (GET, POST, etc.) used to access the page.
HTTP request methods
HTTP request methods (also known as verbs) are used to indicate the desired action to be performed on the identified resource. The most common methods are:
- GET: retrieve information from the server. This is the default method used by browsers when you click on a link.
- POST: submit data to be processed by the server. This is the default method used by browsers when you submit a form.
- PUT: replace the current representation of the target resource with the request payload. Most commonly used in REST APIs.
- DELETE: remove the target resource.
- PATCH, HEAD, OPTIONS, CONNECT, TRACE: less common methods that are used in specific situations.
Example
select 'redirect' as component,
'/error?msg=expected+a+PUT+request' as link,
where sqlpage.request_method() != 'PUT';
insert into my_table (column1, column2) values (:value1, :value2);
basic_auth_password
basic_auth_username
cookie
current_working_directory
environment_variable
exec
fetch
hash_password
header
link
path
persist_uploaded_file
protocol
random_string
read_file_as_data_url
read_file_as_text
request_method
run_sql
uploaded_file_mime_type
uploaded_file_name
uploaded_file_path
url_encode
variables
version