Im trying to read the server names(eg: server1) in a variable and pass it to a url. However, url doesnt take the variable but only the server name hardcoded in it.
Is there any way for me to accomplish this?
def connect_to_BNAserver(BNAserver):
connection = http.client.HTTPConnection(BNAserver)
baseurl="'https://"+BNAserver+"/rest/login'"
header = {"WSUsername": BNAUser, "WSPassword": BNAPass,"Accept": "application/vnd.brocade.networkadvisor+json;version=v1"}
connection.request('POST',BaseUrl,headers=header)
The below works:
header = {"WSUsername": BNAUser, "WSPassword": BNAPass,"Accept": "application/vnd.brocade.networkadvisor+json;version=v1"}
connection.request('POST','https://server1/rest/login',headers=header)