I want to send user id in url request as https://baseurl?query=year=’2011’&&id=’userid1234’ How do I use variable inside urlEncode method? I am not able to use variable inside urlEncode method. urlEncode(‘year=’’$year’’&&id=''$userid''’) I need year and userid in quotes in final api call. Is there any other approach I should be taking in order to create this request.