接口文档
代码示例
procedure btnSendSmsClick(Sender: TObject); var ParamLst: TStrings; ReMsg: WideString; begin btnSendSms.Enabled := False; Screen.Cursor := crHourGlass; ParamLst := TStringList.Create; try if Trim(edtTel.Text) = EmptyStr then Exit; if Trim(mmoSmsCon.Text) = EmptyStr then Exit; begin ParamLst.Add('accName=' + Trim(edtUserName.Text)); ParamLst.Add('accPwd=' + md5(edtPassword.Text)); ParamLst.Add('content=' + UTF8Encode(Trim(mmoSmsCon.Text))); ParamLst.Add('aimcodes=' + Trim(edtTel.Text)); ParamLst.Add('dataType' + 'string'); ReMsg := UTF8Decode(IdHTTP.Post('https://www.lx598.com/sdk/send', ParamLst)); mmoDisplay.Lines.Add('错误代码:' + ReMsg); IdHTTP.Disconnect; IdHTTP.Request.Clear; edtTel.Clear; mmoSmsCon.Clear; end finally btnSendSms.Enabled := True; Screen.Cursor := crDefault; ParamLst.Free; end; end;
procedure btnSendSmsClick(Sender: TObject); var ParamLst: TStrings; ReMsg: WideString; begin btnSendSms.Enabled := False; Screen.Cursor := crHourGlass; ParamLst := TStringList.Create; try if Trim(edtTel.Text) = EmptyStr then Exit; if Trim(mmoSmsCon.Text) = EmptyStr then Exit; begin ParamLst.Add('accName=' + Trim(edtUserName.Text)); ParamLst.Add('accPwd=' + md5(edtPassword.Text)); ParamLst.Add('content=' + UTF8Encode(Trim(mmoSmsCon.Text))); ParamLst.Add('aimcodes=' + Trim(edtTel.Text)); ParamLst.Add('dataType' + 'string'); ReMsg := UTF8Decode(IdHTTP.Post('https://www.lx598.com/sdk/send', ParamLst)); mmoDisplay.Lines.Add('错误代码:' + ReMsg); IdHTTP.Disconnect; IdHTTP.Request.Clear; edtTel.Clear; mmoSmsCon.Clear; end finally btnSendSms.Enabled := True; Screen.Cursor := crDefault; ParamLst.Free; end; end;