Skip to main content
100%

Hello { $who }!

✓ Published0🌍 Public
CCliffordAnderson
Last edited Feb 2, 2018
Created on Feb 2, 2018

This example demonstrates a simple RESTful API that returns an XML response containing a personalized greeting. It uses the BaseX RESTXQ module, declaring a function with the `%rest:path` and `%rest:GET` annotations to handle HTTP GET requests. The path pattern `hello/{$who}` captures a URL segment into the `$who` variable, which is then interpolated into the `<title>` element of the `<response>` document. The code shows how a single annotated function can expose a dynamic endpoint without additional routing logic.

AI-generated description

Similar vizzes