perhaps simplify line by assigning the url to a variable; or assigning variable to endpoint:port that you're presumably extracting from the url here.