🌐Query Parameter
Also known as Query String, URL Parameter, Query Params
A name and value added after a ? in a web address, like ?page=2.
Think of it like
Think of it like the extra notes on an order. Size large, no onions.
Example
Jack filters a shop by colour. The address becomes /shoes?colour=red&size=9, and the server sends back only red shoes in size 9.
Why it matters
They turn a page you filtered or searched into an address. You can share it, save it and load it again.
Definition
Example code
url
https://example.com/search?q=shoes&page=2Common mistake
Key takeaways
- 1After the question mark. At the end of the address.
- 2Name equals value. Split by &.
- 3Public. Never put secrets there.