我正在尝试使用Inno Setup脚本发出HTTP POST身份验证基本请求。
我的努力:
procedure CurStepChanged(CurStep: TSetupStep);
var
WinHttpReq: Variant;
ReqContent: String;
begin
if CurStep = ssInstall then
begin
WinHttpReq := CreateOleObject('WinHttp.WinHttpRequest.5.1');
WinHttpReq.Open('POST', '<http://www.xxxx.com>', false);
WinHttpReq.SetRequestHeader('Content-Type', 'application/json');
ReqContent = {
"UserName":"xxx",
"Password":"abcd"
}
WinHttpReq.Send(ReqContent);
end;
end;
那么,如何通过POST
请求发送用户名和密码?