Einzelnen Beitrag anzeigen

carmeloconny

Registriert seit: 20. Okt 2019
9 Beiträge
 
#11

AW: DelphiXE8 and WSDL, disable authentication via Smart Card Reader

  Alt 30. Nov 2019, 12:29
Excuse my absence for all those who helped me.
The problem has not been resolved.
looking for a solution on the internet, I realized that I have to use WinHttp instead of WinINet.
WinHttp should not display dialogs, which is what I want.


I tried to replace, in HTTPRIOHTTPWebNode1BeforePost:
Code:
   auth := 'Authorization: Basic ' + TNetEncoding.Base64.Encode(FUserName + ':' + FPassword);

   if not HttpAddRequestHeaders(Data, PChar(auth), Length(auth), HTTP_ADDREQ_FLAG_ADD) then
   ShowMessage('HttpAddRequestHeaders' + SysErrorMessage(GetLastError()));
with
Code:
   auth := 'Authorization: Basic ' + TNetEncoding.Base64.Encode(FUserName + ':' + FPassword);
   if not WinHttpAddRequestHeaders(Data, PChar(auth), Length(auth), WinHTTP_ADDREQ_FLAG_ADD) then
   ShowMessage('WinHttpAddRequestHeaders: ' + SysErrorMessage(GetLastError()));
this doesn't work,error "handle is invalid".
how can I use WinHttp with HttpRio?
  Mit Zitat antworten Zitat