Bird
0
0

Given the following API Gateway configuration snippet, what will be the response path for a client request to /orders/123?

medium📝 Predict Output Q13 of 15
Rest API - Advanced Patterns
Given the following API Gateway configuration snippet, what will be the response path for a client request to /orders/123?
{
  "/orders": "http://order-service/api/v2/orders"
}
Ahttp://order-service/api/v2/orders/orders/123
Bhttp://order-service/api/v2/orders
Chttp://order-service/orders/123
Dhttp://order-service/api/v2/orders/123
Step-by-Step Solution
Solution:
  1. Step 1: Understand path forwarding in API Gateway

    The gateway appends the path after the route key to the backend URL. Here, "/orders" is the route key, so "/123" is appended.
  2. Step 2: Construct the full backend URL

    Appending "/123" to "http://order-service/api/v2/orders" results in "http://order-service/api/v2/orders/123".
  3. Final Answer:

    http://order-service/api/v2/orders/123 -> Option D
  4. Quick Check:

    Request path appended after route key URL [OK]
Quick Trick: API Gateway appends extra path after route key URL [OK]
Common Mistakes:
MISTAKES
  • Not appending the extra path segment
  • Duplicating the route key in backend URL
  • Ignoring the original request path

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes