Added URL encoding for requests with query parameters