问问大家,如果供应商提供了一个HTTP接口发短信,那么在DELPHI里怎么调用来发信息?
例如:http://gbk.sms.webchinese.cn/?Uid=本站用户名&Key=接口安全密码&smsMob=手机号码&smsText=短信
请提供代码,谢谢!

解决方案 »

  1.   

    procedure TForm1.btn1Click(Sender: TObject);
    var
      strMsg:string;
      response:Tstringstream;
      postlist:tstringlist;
    begin
      postlist := TStringlist.create;
      postlist.Clear;
      response := TStringStream.create('');
      idHTP1.HandleRedirects := True;
      postlist.add('Uid=本站用户名') ;
      postlist.add('Key=接口安全密码') ;
      IdHTP1.Request.ContentType := 'application/x-www-form-urlencoded';
      IdHTP1.Request.UserAgent:='Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; Maxthon)';  try  IdHTP1.post('http://172.29.186.206/login.php',postlist,response) ;