Bird
0
0

Given the following GET request URL: /products?category=books&limit=3, what does the server most likely return?

medium📝 Predict Output Q13 of 15
Rest API - HTTP Methods
Given the following GET request URL: /products?category=books&limit=3, what does the server most likely return?
AAll products without filtering
BProducts with category 'limit' and quantity 3
CAn error because of invalid query parameters
DFirst 3 products in the books category
Step-by-Step Solution
Solution:
  1. Step 1: Analyze the query parameters

    The URL has two query parameters: category=books and limit=3, which filter products by category and limit the number returned.
  2. Step 2: Understand typical API behavior

    APIs commonly use 'category' to filter items and 'limit' to restrict the number of results returned.
  3. Final Answer:

    First 3 products in the books category -> Option D
  4. Quick Check:

    Query filters + limit = filtered limited results [OK]
Quick Trick: Query params filter and limit results [OK]
Common Mistakes:
  • Ignoring query parameters and returning all data
  • Misreading 'limit' as a category
  • Assuming query causes error

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes