Article View: borland.public.cppbuilder.internet.web
Article #809Re: Indy version, Post method
From: Denville Longhurst
Date: Wed, 01 Feb 2006 15:57
Date: Wed, 01 Feb 2006 15:57
78 lines
3664 bytes
3664 bytes
Many thanks, particularly for your prompt and generous replies.
Denville.
"Remy Lebeau (TeamB)" <no.spam@no.spam.com> wrote in message
news:43dff852$1@newsgroups.borland.com...
>
> "Denville Longhurst" <Denville@metco.co.uk> wrote in message
> news:43dff36a@newsgroups.borland.com...
>
>> OK, here is a simple, working form that illustrates what I
>> want to achieve from a BCB application using Indy
>> (TIdHTTP v 8.0.25)
>
> That is a VERY VERY old version of Indy. Indy 8 is no longer supported by
> Indy's developers (including me). You should upgrade to at least the
> latest
> Indy 9.0.50 snapshot.
>
> Under Indy 9 (and 10), the code would be one of the following, depending
> on
> whether the script expects data to be posted using the
> "multipart/form-data"
> encoding or not:
>
> 1)
>
> TStringList *Values = new TStringList;
> try
> {
> Values->Add("recipient=fpl@metco.co.uk");
> Values->Add("env_report=REMOTE_HOST,REMOTE_ADDR,HTTP_USER_AGENT");
> Values->Add("print_config=email,realname,subject");
> Values->Add("sort=order:message");
> Values->Add("print_blank_fields=1");
>
> Values->Add("redirect=http://www.metco.co.uk/MyTemp/FplWeback1.htm");
> Values->Add("email=a.pilot@metco.co.uk");
> Values->Add("MyName=Denville");
> Values->Add("MyTown=Leeds, England");
> Values->Add("Submit=Submit");
> Memo1->Text =
> IdHTTP1->Post("http://cgi.uk2.net/cgi-bin/uk2-formmail.pl", Values);
> }
> __finally {
> deleteValues;
> }
>
> 2)
>
> #include "IdMultipartFormData.hpp"
>
> TIdMultipartFormDataStream *Values = new TIdMultipartFormDataStream;
> try
> {
> Values->AddFormField("recipient", "fpl@metco.co.uk");
> Values->AddFormField("env_report",
> "REMOTE_HOST,REMOTE_ADDR,HTTP_USER_AGENT");
> Values->AddFormField("print_config", "email,realname,subject");
> Values->AddFormField("sort", "order:message");
> Values->AddFormField("print_blank_fields", "1");
> Values->AddFormField("redirect",
> "http://www.metco.co.uk/MyTemp/FplWeback1.htm");
> Values->AddFormField("email", "a.pilot@metco.co.uk");
> Values->AddFormField("MyName", "Denville");
> Values->AddFormField("MyTown", "Leeds, England");
> Values->AddFormField("Submit", "Submit");
> Memo1->Text =
> IdHTTP1->Post("http://cgi.uk2.net/cgi-bin/uk2-formmail.pl", Values);
> }
> __finally {
> deleteValues;
> }
>
>
> Gambit
>
>
Technical Details
Message-ID:
<43e0d9ff@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad01.newshosting.com!newshosting.com!news-peer0-test!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mailReferences:
<43df9c82@newsgroups.borland.com> <43dfa6dd$5@newsgroups.borland.com> <43dff36a@newsgroups.borland.com> <43dff852$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: feeec,e22aba21c3053d6a X-Google-Attributes: gidfeeec,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Denville Longhurst" <Denville@metco.co.uk> Newsgroups: borland.public.cppbuilder.internet.web References: <43df9c82@newsgroups.borland.com> <43dfa6dd$5@newsgroups.borland.com> <43dff36a@newsgroups.borland.com> <43dff852$1@newsgroups.borland.com> Subject: Re: Indy version, Post method Date: Wed, 1 Feb 2006 15:57:57 -0000 Lines: 80 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-RFC2646: Format=Flowed; Original NNTP-Posting-Host: 80.0.6.88 Message-ID: <43e0d9ff@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1138809343 80.0.6.88 (1 Feb 2006 07:55:43 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad01.newshosting.com!newshosting.com!news-peer0-test!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail