Log in twice via Idhttp
I have placed an Idhttp component on my main form and an IdSSLIOHandlerSocketOpenSSL and both components are not adjusted via the IDE. I use it to access two servers: 1) A http server which requires an authentication; 2) A https-server (which requires an authentication). When I connect via Idhttp to server (1) I can connect via a regular fashion. However, when I connect to server (2) it returns a message that the user credentials are not correct. I tried switching the procedures but then I cannot login into server (1): I get in both situations the response from the server that I input wrong credentials. I presume some property is changed. I checked the Idhttp.Request.UserName and Idhttp.Request.Password before I connect and they are correct. What is going wrong? procedure TForm1.AccessServer1; var fs: TMemoryStream begin fs := TMemoryStream.Create; IdHTTP1.Request.BasicAuthentication := true; IdHTTP1.Request.UserName := myUsername1; IdHTTP1.Request.Password := MyPassword1; try IdHTTP1.Get(myURL1, fs); fs.SaveToFile(MyFilename); finally fs.free end; end; procedure TForm1.AccessServer2; var fs: TMemoryStream begin fs := TMemoryStream.Create; IdHTTP1.Request.BasicAuthentication := true; IdHTTP1.Request.UserName := myUsername2; IdHTTP1.Request.Password := MyPassword2; IdHTTP1.HandleRedirects := True; IdHTTP1.IOHandler := AIdSSLIOHandlerSocketOpenSSL; try IdHTTP1.Get(myURL2, fs); fs.SaveToFile(MyFilename); finally fs.free end; end;
Delphi7: Is there a better place or way to save the last used document number other than the AfterPost event?
quickreport exporttortf doc without textbox
Get Network Path of a file [duplicate]
How can I get the metaclass of a class in Delphi 7?
TidTCPClient expecting reply from TidTCPServer
Lazarus get sql result to dbedit
Compile FreeReport in Delphi 7
How to respond with a pdf for browser with idhttpserver?
Faster Printing on Dot Matrix Printers with Arabic Support in Delphi
Find out which button user clicked to close Twwsearchdialog
Using DDL to create a Foreign Key, with Delphi
Memo line split
How to get appdata folder path in delphi
jclRegistry (jesi 2.10) windows 7 delphi7
Auto clear default text in a TEdit
Create a numerical probability generator - Euromillions Generator