0.5.11 Query Parameters

A URL Can Carry Information With the Request

You already know that a URL can contain:

  • a scheme;
  • a host;
  • a path.

A URL can also include query parameters.

Query parameters provide additional information that the client sends as part of the request.

Consider:

Activity diagram showing user enters location, then program builds query information, then browser requests URL.
UserEntersLocation.
  • New
  • Changed
  • Removed

The exact URL format depends on the website being used.

Do not assume every website expects:

Activity diagram showing User supplies information, then Program builds URL, then Query parameter carries information, then Browser sends request, then Server processes the request, then Browser displays the response.
UserSuppliesInformation.
  • New
  • Changed
  • Removed

The next Learning Activity focuses on the program side of that connection: assembling a URL from supplied user input in C#.