Invalid Approach to Pass Parameter to a REST Resource | Oracle Exam 1Z0-900

Invalid Approach to Pass a Parameter to a REST Resource

Question

Which URL represents an invalid approach to pass a parameter to a REST resource?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

D.

In RESTful web services, parameters can be passed to a resource using various approaches such as query parameters, path parameters, and matrix parameters. However, some of these approaches might not be valid or might not work as intended.

Let's consider each URL option and see if it represents a valid approach to pass a parameter to a REST resource:

A. <base-url>/Employees?value=1

This URL represents a valid approach to pass a parameter to a REST resource using query parameters. The query parameter "value" is passed with a value of 1.

B. <base-url>/Employees&amp;value=1

This URL is not a valid approach to pass a parameter to a REST resource using query parameters. The ampersand character "&" is used instead of "?" to separate the base URL from the query parameter. In addition, the ampersand character is HTML-encoded, which might cause issues with certain web servers or frameworks.

C. <base-url>/Employees/1

This URL represents a valid approach to pass a parameter to a REST resource using path parameters. The value "1" is passed as a path parameter in the URL. Path parameters are often used to identify a specific resource or entity.

D. <base-url>/Employees;value=1

This URL is not a valid approach to pass a parameter to a REST resource using matrix parameters. Matrix parameters are separated from the base URL using a semicolon character ";". However, this URL uses a semicolon followed by the parameter name "value", which is not a valid matrix parameter syntax.

Therefore, the answer is option B. <base-url>/Employees&amp;value=1 is not a valid approach to pass a parameter to a REST resource using query parameters.