Each HTTP function contains a method definition that is used to call the corresponding custom site API.
The method is defined in the function declaration:
HTTP functions support the following method declarations:
get
Calls your custom site API using the HTTP GET
method.
Usually, GET
methods are used only to retrieve a resource. If the resource is found, your function should respond with a 200 (OK) status code and the requested resource.
Learn more about get
HTTP functions.
post
Calls your custom site API using the HTTP POST
method.
Usually, POST
methods are used to create a new resource. If the resource is successfully created, your function should respond with a 201 (Created) status code and a reference to the created resource.
Learn more about post
HTTP functions.
put
Calls your custom site API using the HTTP PUT
method.
Usually, PUT
methods are used to update a resource. If the resource is successfully updated, your function should respond with a 200 (OK) status code. If the resource didn't exist so it was created, your function should respond with a 201 (Created) status code.
Learn more about put
HTTP functions.
delete
Calls your custom site API using the HTTP DELETE
method.
Usually, DELETE
methods are used to delete a resource. If the resource is successfully deleted, your function should respond with a 200 (OK) status code.
Learn more about delete
HTTP functions.
use
Calls your custom site API using any HTTP method, unless there is another function with the same name defined for that specific HTTP method.
For example, if you create 2 HTTP functions, called get_myFunction
and use_myFunction
, GET
calls to myFunction
will be handled by get_myFunction
, but POST
, PUT
, and DELETE
calls to myFunction
will be handled by use_myFunction
.
Learn more about use
HTTP functions.