If yes, please grant instruction!
Be very grateful!
CodePudding user response:
Using TIdHTTPWebBrokerBridgeResponse WeChat server GET and POST over data
But the advice is to use PHP or ASP.NET to do
Under a code before, do not remember the original author, thanks to the source author
Procedure TWebModule1. WebModule1CheckSignatureAction (Sender: TObject;
Request: TWebRequest; Response: TWebResponse; Var Handled: Boolean);
Var
Signature: string;
Timestamp: string;
Nonce: string;
Echostr: string;
STRS: TStringList;
TmpStr: string;
The begin
Signature:=Request. QueryFields. Values [' signature '];
Timestamp:=Request. QueryFields. Values [' timestamp];
Nonce:=Request. QueryFields. Values [' nonce];
Echostr:=Request. QueryFields. Values [' echostr];
The STRS: TStringList=. Create;
STRS. Add (Token);
STRS. Add (timestamp);
STRS. Add (nonce);
STRS. Sort;
TmpStr:=STRS STRS [0] + [1] + STRS [2].
TmpStr:=SHA1 (tmpStr);
If tmpStr=signature then
The Response. The Content:=echostr
The else
The Response. The Content:=' ';
STRS. Destroy;
end;
//the default HTTP service response to test for a normal HTTP service
Procedure TWebModule1. WebModule1DefaultHandlerAction (Sender: TObject;
Request: TWebRequest; Response: TWebResponse; Var Handled: Boolean);
The begin
The Response. The Content:='& lt; html> <meta HTTP - equiv="content-type" Content="text/HTML. Charset="GB2312"/& gt; <body> The server normal oh & lt;/body>