delphi-7


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;

Related Links

how to key vietnamese in delphi 7
Searching for a Corresponding Value in a TList Delphi7
Ado Query in Delphi 7 To Converts Joined Columns Into Rows Based on Primary Key
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

Categories

HOME
go
prism
cheerio
developer-tools
css3
angular2-material
numbers
sitecore
yandex
aws-cli
tvos
32bit-64bit
drop-down-menu
cmdb
radgridview
libusb
linear-algebra
internationalization
mvc-mini-profiler
firefox-addon
chargify
soci
nodemcu
articulate-storyline
roslyn
pchart
scriptella
flask-sqlalchemy
beautifier
surveymonkey
licensing
mat
ms-access-2003
android-things
twiml
google-earth
calculation
autolisp
baidu-map
protege4
google-earth-engine
ideascript
bindingnavigator
show-hide
memory-mapping
x++
puredata
servermanager
google-cse
scalding
modelsim
arules
check-mk
d3-force-directed
gameplay-kit
grails-plugin
reporting-services-2012
lrs
file-uri
beamer
wso2developerstudio
kango-framework
lua-telegram-bot
riot
project-organization
thread-sleep
kendo-upload
sciruby
rubaxa-sortable
coda
canalyzer
sha512
aspectj-maven-plugin
mmwormhole
beatsmusic
angular-gettext
administration
cbind
tweenlite
gii
personalization
alternate
synapse
qscrollarea
getopt
sbcl
bin
http-patch
abstract-data-type
octal
android-icons
superscrollorama
frameworkelementfactory
wcf-configuration
rmiregistry
predicatebuilder
hibernateexception
pinch
jquery-tools
google-ajax-api
qtabbar
lobo-cobra
cuda.net
windows-identity
unmanagedresources
product-management
cardspace
great-circle
pnrp

Resources

Database Users
RDBMS discuss
Database Dev&Adm
javascript
java
csharp
php
android
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App