encode a url in swift
use urlcomponents to encode the url
var components = URLComponents(string: "http://localhost:8000/football/fixtures")!
components.queryItems = [
URLQueryItem(name: "date", value: "2025-03-29"),
URLQueryItem(name: "timezone", value: "America/Los_Angeles")
]
let url = components.url
print(url?.absoluteString ?? "Invalid URL")
// Output: http://localhost:8000/football/fixtures?date=2025-03-29&timezone=America%2FLos_Angeles