Compose a GET URL. Input: line 1 — base URL; line 2 — params JSON object (skip null values; encode the rest; keys in JSON order). Print the final URL (no ? if nothing survives).
Input: two lines. Output: the URL.
Your program reads from stdin and prints to stdout.
Example 1
Input: https://api.dev/search {"q":"react hooks","page":2}
Output: https://api.dev/search?q=react%20hooks&page=2
Hints
Compose a GET URL. Input: line 1 — base URL; line 2 — params JSON object (skip null values; encode the rest; keys in JSON order). Print the final URL (no ? if nothing survives).
Input: two lines. Output: the URL.
Your program reads from stdin and prints to stdout.
Example 1
Input: https://api.dev/search {"q":"react hooks","page":2}
Output: https://api.dev/search?q=react%20hooks&page=2
Hints