🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: What's wrong with this?

#3106
From: Remy Lebeau (TeamB)
Date: Fri, 18 Nov 2005 09:39
51 lines
2310 bytes
"dzeidzei" <dzeidzei@suolakaivos.com> wrote in message
news:437d851c$1@newsgroups.borland.com...

> Now I've upgraded to Indy 90017

The latest snapshot build is 9.0.50.

> and my function looks as follows:

Get rid of the Intercept.  It is no longer needed.  The IOHandler will
handle everything.

>       delete IdConnectionIntercept;
>       delete IdSSLIOHandlerSocket;

Get rid of those.  They are not needed since the TIdHTTP is the owner for
them.

The code can be as follows:

    #include <memory>

    AnsiString HttpsPostSMS(const AnsiString &Url, const AnsiString &Params)
    {
        try
        {
            std::auto_ptr<TIdHTTP> HTTP(new TIdHTTP(NULL));
            TIdSSLIOHandlerSocket *SSL = new
TIdSSLIOHandlerSocket(HTTP.get()) ;

            SSL->SSLOptions->Method = sslvSSLv23;
            SSL->SSLOptions->Mode = sslmClient;
            SSL->SSLOptions->VerifyDepth = 0;
            HTTP->IOHandler = SSL;

            std::auto_ptr<TStringStream> tsParams(new
TStringStream(Params));
            HTTP->Request->ContentType =
"application/x-www-form-urlencoded";

            return HTTP->Post(Url, tsParams.get()).Trim();
        }
        catch(const Exception &e)
        {
            return ("Error: " + e.Message);
        }
    }


Gambit
Technical Details
Message-ID: <437da128$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!newshub.sdsu.edu!logbridge.uoregon.edu!newsfeeds.ihug.co.nz!ihug.co.nz!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> <437d851c$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: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com>
Newsgroups: borland.public.cppbuilder.internet.socket
References: <437b2354$1@newsgroups.borland.com> <437ba8a7$1@newsgroups.borland.com> <437c19ea$1@newsgroups.borland.com> <437c306b$1@newsgroups.borland.com> <437d851c$1@newsgroups.borland.com>
Subject: Re: What's wrong with this?
Date: Fri, 18 Nov 2005 01:39:17 -0800
Lines: 53
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
NNTP-Posting-Host: 68.69.17.41
Message-ID: <437da128$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1132306728 68.69.17.41 (18 Nov 2005 01:38:48 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!newshub.sdsu.edu!logbridge.uoregon.edu!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail