Kachar ganyalong Posted April 22, 2017 Share Posted April 22, 2017 Please give me simple way to POST string to URL. 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; 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 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. Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now