My program uses httpbasic authorization and for each request pages from the 
same site every time they repeatedly send the same headers c pair of login: 
password. Is it possible to save the login session, and do not send headers 
"Authorization: Basic" & autentificate & "c L" over and over again? This code 
is used in the loop for pages:
    
    
    proc requestpage(url: string,
                     headers: string,
                     timeout: int
                     ) : tuple[resp: Response,err: string,ok:bool] =
      
      var
        resp: Response
        err: string = ""
        ok:  bool   = false
      
      try:
        resp = httpclient.get(url,headers,timeout)
        ok = resp.status == "200 OK"
      except:
        err = getCurrentExceptionMsg()
        tee("Error:" & err,[logFile,""],fg=fgYellow)
      return (resp,err,ok)
    

Reply via email to