🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.internet.socket
Article #3102

Re: What's wrong with this?

#3102
From: dzeidzei
Date: Fri, 18 Nov 2005 06:39
37 lines
2136 bytes
Now I've upgraded to Indy 90017 and my function looks as follows:

AnsiString HttpsPostSMS(const AnsiString &Url, const AnsiString &Params)
{
  AnsiString asResponse;
  try
  {
		std::auto_ptr<TIdHTTP> IdHTTP(new TIdHTTP(NULL));
    TIdConnectionIntercept *IdConnectionIntercept = new TIdConnectionIntercept(IdHTTP.get());
		TIdSSLIOHandlerSocket *IdSSLIOHandlerSocket = new TIdSSLIOHandlerSocket(IdHTTP.get()) ;
    TStringStream * tsParams = new TStringStream(Params);

    try
    {
      IdSSLIOHandlerSocket->SSLOptions->Method = sslvSSLv23;
  		IdSSLIOHandlerSocket->SSLOptions->Mode = sslmClient;
  		IdSSLIOHandlerSocket->SSLOptions->VerifyDepth = 0;
      IdHTTP->Request->ContentType = "application/x-www-form-urlencoded";
    	IdHTTP->Intercept = IdConnectionIntercept;
    	IdHTTP->IOHandler = IdSSLIOHandlerSocket;
  	asResponse = IdHTTP->Post(Url, tsParams);

    	return (asResponse.Trim());
    }
    __finally
    {
    delete tsParams;
      delete IdConnectionIntercept;
      delete IdSSLIOHandlerSocket;
    }
  }
  catch(const Exception &e)
  {
   	return ("Error: " + e.Message);
  }
}
Technical Details
Message-ID: <437d851c$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!newsfeed.hal-mli.net!feeder1.hal-mli.net!news-out.newsfeeds.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <437b2354$1@newsgroups.borland.com> <437ba8a7$1@newsgroups.borland.com> <437c19ea$1@newsgroups.borland.com> <437c306b$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,4165e9ea369c7fad
X-Google-Attributes: gid11508e,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "dzeidzei" <dzeidzei@suolakaivos.com>
Sender: "dzeidzei" <dzeidzei@suolakaivos.com>
Reply-To: "dzeidzei" <dzeidzei@suolakaivos.com>
Subject: Re: What's wrong with this?
Newsgroups: borland.public.cppbuilder.internet.socket
X-User-Info: 192.107.203.51     
References: <437b2354$1@newsgroups.borland.com> <437ba8a7$1@newsgroups.borland.com> <437c19ea$1@newsgroups.borland.com> <437c306b$1@newsgroups.borland.com>
NNTP-Posting-Host: 207.105.83.66
Message-ID: <437d851c$1@newsgroups.borland.com>
Date: 17 Nov 2005 23:39:08 -0700
X-Trace: newsgroups.borland.com 1132299548 207.105.83.66 (17 Nov 2005 23:39:08 -0700)
Lines: 37
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!newsfeed.hal-mli.net!feeder1.hal-mli.net!news-out.newsfeeds.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail