Article View: borland.public.cppbuilder.internet.socket
Article #3109Re: What's wrong with this?
From: dzeidzei
Date: Fri, 18 Nov 2005 08:57
Date: Fri, 18 Nov 2005 08:57
58 lines
2511 bytes
2511 bytes
Thanks!
But when I paste Your code to my function, I still get 'IOHandler value is not valid' when calling???
"Remy Lebeau \(TeamB\)" <no.spam@no.spam.com> wrote:
>
>"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:
<437da596$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news2.volia.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<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> <437da128$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" <dzei@suolakaivos.com> Sender: "dzeidzei" <dzei@suolakaivos.com> Reply-To: "dzeidzei" <dzei@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> <437d851c$1@newsgroups.borland.com> <437da128$1@newsgroups.borland.com> NNTP-Posting-Host: 207.105.83.66 Message-ID: <437da596$1@newsgroups.borland.com> Date: 18 Nov 2005 01:57:42 -0700 X-Trace: newsgroups.borland.com 1132307862 207.105.83.66 (18 Nov 2005 01:57:42 -0700) Lines: 59 Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news2.volia.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail