Which URL represents an invalid approach to pass a parameter to a REST resource?
Which URL represents an invalid approach to pass a parameter to a REST resource?
The URL <base-url>/Employees&value=1 is invalid because the ampersand (&) character is not used to initiate query parameters in a URL. Query parameters should be introduced with a question mark (?) and separated by ampersands if there are multiple parameters. The correct format would be <base-url>/Employees?value=1. Other provided URL formats, like using question marks for query parameters, slashes for path parameters, and semicolons for matrix parameters, are valid approaches within RESTful APIs.
Correct Answer: B
invalid approach is B. (PathParam /x/123 QueryParam /x?v=2 MatrixParam /x;v=2)
I think that answers A and B use parameters in the URL as query parameter, but de 2nd is incorrect that is the question, so I choose B as correct answer (invalid approach).
Correct answers are A and C since parameters can be passed either via query param or path variable