APIGEE-API-ENGINEER practice question 13 of 25
You are using the Apigee ExtractVariables policy JSONPath feature, and discover that the query is not returning the expected result for the payload you are providing What should you do?
Full set: 126 questionsThe Apigee ExtractVariables policy uses JSONPath to extract data from a message payload that is in JSON format. For Apigee's parser to correctly interpret the message body as JSON, the Content-Type header of that message (either the request or response) must be explicitly set to application/json. If the header is missing, incorrect, or set to another value (e.g., text/plain), the policy will not treat the payload as a JSON object. Consequently, the JSONPath expression will fail to find any matching paths, resulting in the query not returning the expected value.
A. The Accept header indicates the media types the client can process in a response; it does not describe the format of the current payload being parsed.
B. The Accept header is irrelevant for parsing the current message's payload. It is a client-side header used for content negotiation for the response.
C. While Content-Type is the correct header, text/json is an obsolete and non-standard media type. The official standard specified by IETF RFC 8259 is application/json.
1. Google Cloud Apigee Documentation
"Extract Variables policy": Under the element description
the documentation states: "The message must be parsed as JSON by Apigee. If the message is not valid JSON
or if the message is not parsed as JSON for other reasons (such as the Content-type header not being application/json)
the policy will not be able to extract any variables." This directly confirms that the Content-Type header must be application/json.
Source: Google Cloud Documentation > Apigee > Reference > Policies > Extract Variables policy reference.
2. IETF RFC 8259
"The JavaScript Object Notation (JSON) Data Interchange Format": This official standard defines the media type for JSON.
Section 11
"IANA Considerations": "The MIME media type for JSON text is application/json." This establishes application/json as the correct and standard value.
Keep practicing
Take the free APIGEE-API-ENGINEER practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other APIGEE-API-ENGINEER practice questions
- Question 1In your last release, there were unexpected errors uncovered by users within the first 24…
- Question 2Your company runs their internal services across two datacenters in a hot-warm configurat…
- Question 3Which features are supported in the OAulhV2 policy'? Select all that are correct. Choose …
- Question 4Which is a benefit of three-legged OAuth (authonzation_code grant)'?
- Question 5Which Apigee product feature can be used to host and version your API documentation'?
- Question 6As an API Engineer your team would like to make sure you are simulating a user experience…
