Skip to content
CodeKruPro

Encoding search text in a query parameter

QuizEasy-Medium

A tester builds this URL by hand to search for red shoes & bags:

GET /products?q=red shoes & bags&page=1

The API searches for the wrong text. What is the problem?

  • The & inside the search text starts a new parameter; it must be encoded as %26 (and spaces as %20 or +)
  • Query parameters cannot contain spaces at all, so the search is impossible
  • The page parameter must come first
  • GET requests cannot carry search text

This question is part of Pro+

Pro+ opens every question in Interview Prep and the mock interview. Every article and the first 2 questions of each topic stay free. Hands-on Selenium and API tasks follow their course lesson's own lock.

See Pro+

Already have Pro+? Sign in