Input Parameters in the URL Path

Previous Next

You can create a custom REST service method with input parameters that are passed as part of the URL path. In the following URL, '154' is an input parameter specifying the ID of a requested resource:

http://localhost:8090/mycustomservice/ActiveBookings/154

 

To make this work, In Service Definer, the Relative URI Path of the method must be:

/ActiveBookings/{booking_id}

 

and you need to have an input parameter with the Annotation set to:

@PathParam("booking_id")

 

You can then use the value of the parameter in the implementation of the method.

The URL path is not suitable for passing more than 1 input parameter. If your method has multiple input parameters, consider using the URL query string or matrix parameters instead.

 

See Also

Input parameters

Input Parameters in the URL Query String

Input Parameters as Matrix Parameters

Input Parameters as HTTP Headers

Example: a REST Service for manipulating data (UPDATE)

Example: a REST Service for returning manipulated data