【发布时间】:2013-07-29 18:54:10
【问题描述】:
网关网站“提供”的代码位于http://www.freesmsgateway.com/api 我尽力实现这一点,但不知道。谷歌广泛搜索无济于事。这在程序中实现非常酷,所以我希望详细的答案能够帮助很多人。它似乎发布了,所以也许我把参数解释错了?任何帮助或输入都是有价值的。请原谅任何格式错误?第一次在网站上发布海报。顺便说一句,使用德尔福 XE4。消息输出在showmessage returned text下面的链接中。
这里是delphi代码:
function tform1.PostExample: string;
var param:TStringList;
valid:boolean;
url,text:string;
http:TIDHttp;
begin
http := TIDHttp.Create(nil);
http.HandleRedirects := true;
http.ReadTimeout := 5000;
param:=TStringList.create;
param.Clear;
param.Add('access_token=994ad8885430************91b6eb8f');
param.Add('message=Test');
param.Add('send_to=0729122723');
valid:=true;
url:='http://www.FreeSMSGateway.com/api_send';
try
text:=http.Post(url,param);
except
on E:Exception do
begin
valid:=false;
end;
end;
if valid then
showmessage( text )
else
showmessage( '' );
end;
end.
【问题讨论】:
标签: delphi http-post delphi-xe2 sms-gateway