Kachar ganyalong Posted April 22, 2017 Share Posted April 22, 2017 Please give me simple way to POST string to URL. Quote Link to comment Share on other sites More sharing options...
Ron Posted April 24, 2017 Share Posted April 24, 2017 function PostString(s, url:string):string; var aResponse: TStringStream; aParams:TStringList; mHTTP:TidHTTP; LHandler: TIdSSLIOHandlerSocketOpenSSL; begin mHTTP := TIdHTTP.Create(nil); mHTTP.Request.BasicAuthentication:=false; aParams := TStringList.Create; try LHandler := TIdSSLIOHandlerSocketOpenSSL.Create(nil); aParams.add('Body='+s); aResponse := TStringStream.Create; try mHTTP.IOHandler:=LHandler; mHTTP.Post(url, aParams, aResponse); finally Result:=aResponse.DataString; LHandler.Free; end; finally aParams.Free; aResponse.Free; mHTTP.Free; end; end; Quote Link to comment Share on other sites More sharing options...
Kachar ganyalong Posted April 24, 2017 Author Share Posted April 24, 2017 Thank you, I will test Quote Link to comment Share on other sites More sharing options...
Ron Posted April 24, 2017 Share Posted April 24, 2017 You have to modify the params according to need, and remove the IOSSL if not using https. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.