I can't log me to a service with basic authentification.
I ve password and login in httpwebnode but i don't see it in the http
header.
Can you help me please ?
From: http://shenoyatwork.blogspot.com/2004/10/back-after-break.html
Issues: The HTTPRio.HTTPWebNode.UserName and .Password properties are
used only in situations where theres a proxy. But let's assume you
wanted to use these for basic authentication. You're going to have to
set an event handler for HttpRio.HttpWebNode.OnBeforePost. You get a
Data parameter here, and this is the HRequest used for sending the data.
All you now have to do is write something like this in the event
handler:
if not InternetSetOption(Data, INTERNET_OPTION_USERNAME,
PChar(HTTPRIO1.HTTPWebNode.UserName),
Length(HTTPRIO1.HTTPWebNode.UserName)) then
ShowMessage(SysErrorMessage(GetLastError));
if not InternetSetOption(Data, INTERNET_OPTION_PASSWORD,
PChar(HTTPRIO1.HTTPWebNode.Password),
Length (HTTPRIO1.HTTPWebNode.Password)) then
ShowMessage(SysErrorMessage(GetLastError));
You can of course set any other password you want. Note: You need to
add WinInet and SOAPHttpTrans to your uses clause.
--
Deepak Shenoy (TeamB)
http://shenoyatwork.blogspot.com
"oops" <a...@ppp.fr> a écrit dans le message de news:
4461...@newsgroups.borland.com...
"Deepak Shenoy (TeamB)" <nom...@nomail.com> a écrit dans le message de news:
4461b1b8$1...@newsgroups.borland.com...
- <HTTPHeaders>
<soapaction>""</soapaction>
<content-type>text/xml</content-type>
<user-agent>Borland SOAP 1.2</user-agent>
<host>localhost:8080</host>
<content-length>818</content-length>
<connection>Keep-Alive</connection>
<cache-control>no-cache</cache-control>
</HTTPHeaders>
But nothing about password
"Deepak Shenoy (TeamB)" <nom...@nomail.com> a écrit dans le message de news:
4461b1b8$1...@newsgroups.borland.com...
"Deepak Shenoy (TeamB)" <nom...@nomail.com> a écrit dans le message de news:
4461b1b8$1...@newsgroups.borland.com...
"oops" <a...@ppp.fr> a écrit dans le message de news:
4461d5da$1...@newsgroups.borland.com...
tLogin := 'Basic ' + Base64Encode('monlogin:monpasse');
if not HttpAddRequestHeaders( data,
pChar('Authorization:'+tLogin),
Length('Authorization:'+tLogin),
HTTP_ADDREQ_FLAG_ADD) then
ShowMessage(SysErrorMessage(GetLastError));
"Deepak Shenoy (TeamB)" <nom...@nomail.com> a écrit dans le message de news:
4461b1b8$1...@newsgroups.borland.com...