Are you sure 'url2' is supposed to start with "secondPartOfUrl"?
Try setting this to true. Then you can look for the "headers received" message on Serial Monitor. You might want to print out those headers, too by adding:
Serial.println(line);
between
String line = client.readStringUntil('\n');
and
if (line == "\r") {