Sample code – HTTP(s) – Delphi

The following Sample code shows, how to send make an integration in Delphi with HTTPs:

function PostExample: string;
var
  lHTTP: TIdHTTP;
  lParamList: TStringList;
begin
  lParamList := TStringList.Create;
  lParamList.Add('login=brugernavn');
  lParamList.Add('password=kodeord');
  lParamList.Add('to=+4540818824');
  lParamList.Add('from=MyCompany');
  lParamList.Add('message=Test besked');
  lHTTP := TIdHTTP.Create(nil); 
  try 
	Result := lHTTP.Post('https://api.suresms.com/Script/SendSMS.aspx/', lParamList); 
  finally 
	lHTTP.Free; 
	lParamList.Free; 
  end; 
end;

It is nessasary to change the parametres, so that they do match the username and Password, you recieved when opening your SureSMS account!

Should you have any questions, you are allways welcome to send an E-mail to support@suresms.com. We are looking forward to helping you.

Need an account?

Do you still need an account or a free test account? Follow this link and we will make you one in 5 minuts.