JN0-224 practice question 12 of 15

A REST API client uses which two HTTP methods to execute RPC requests on the server? (Choose two.)

Full set: 66 questions
Answer options
A: POST Correct answer
B: HEAD
C: GET Correct answer
D: CONNECT
Correct Answer:
A. POST; C. GET
Explanation

The Junos OS REST API allows a client to execute Remote Procedure Calls (RPCs) on a server (a Juniper device) using two primary HTTP methods. The client can send an HTTP POST request to the /rpc resource URI, including the RPC command and any parameters in the request body. Alternatively, the client can send an HTTP GET request where the RPC is specified directly in the URL, and any necessary arguments are passed as query parameters. Both methods are valid for invoking RPCs.

Why Incorrect

B. HEAD: The HEAD method is used to retrieve the headers of a resource without the message body. It is not used to execute an action or an RPC.
D. CONNECT: The CONNECT method is used to establish a network tunnel, typically for proxying HTTPS traffic, and is not used for executing RPCs.

References

1. Juniper Networks TechLibrary, Junos OS REST API Guide. In the section "Executing RPCs Using the REST API," the documentation explicitly states: "To execute an RPC, the client application sends an HTTP POST or GET request to the RPC resource URI on the target device." It provides distinct examples for both methods.

Source: Juniper Networks, "Junos OS REST API Guide," section on "Executing RPCs Using the REST API."

2. Juniper Networks TechLibrary, REST API Overview. This guide reinforces the concept, explaining that RPCs can be executed via the REST API. The examples provided for RPC execution consistently use either GET or POST methods.

Source: Juniper Networks, "REST API Overview," section on "RPC Execution."

Scroll to Top