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

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

Categories

HOME
beautifulsoup
eclipse
search
facebook-oauth
swt
mstest
jelastic
devise
spring-data-redis
replace
cq5
vsm
gluon-mobile
lanczos
flume
rcloud
fhir
appcelerator-studio
emoji
do-while
microsoft-dynamics-nav
dreamweaver
android-7.0-nougat
html5-appcache
sse
topology
symbols
href
interpreter
google-api-client
underscore.js
angular-translate
soot
winexe
browser-sync
recurring-events
utorrent
autolisp
code-snippets
dynamic-jasper
fossil
nested-lists
timing
ideascript
protein-database
odoo-website
oracle-service-bus
outputcache
contract
importerror
vaadin-charts
facebook-social-plugins
pom.xml
proget
jquery-ui-draggable
dtsearch
activeperl
datamaps
mongotemplate
git-flow
sundials
cpu-cache
renaming
taocp
reporting-services-2012
neon
mapinfo
pre-build-event
omniauth-facebook
hadoop-partitioning
createprocess
database-relations
inf
grgit
cgi-bin
amiga
dronekit-android
avahi
uvc
viewer
browserify-shim
metatrader5
wcm
xml-dsig
functional-java
memset
maven-scm
decoupling
square-bracket
amslidemenu
getopt
gwt-openlayers
isqlquery
neos-server
gpars
cmmi
merb
scmmanager
jquery-1.9
argouml
joomla3.1
extreme-programming
patricia-trie
subgraph
kqueue
luabind
screen-size
jqote
inline-formset
django-piston
silverlight-oob
escrow
fault-tolerance
dsoframer

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App