Article View: borland.public.cppbuilder.internet.web
Article #677Re: how to send a string to a url
From: Remy Lebeau (TeamB)
Date: Wed, 23 Aug 2006 16:58
Date: Wed, 23 Aug 2006 16:58
63 lines
2532 bytes
2532 bytes
"Dave" <dave@here.com> wrote in message
news:44ec5b63$1@newsgroups.borland.com...
> I talked to the developer who wrote that java code...it appears
> to be a Get request
According to the Java documentation, the code you showed would send a GET
request. That is why I asked.
> but it is really a Post request.
I thought as much. In that case, if you were to use Indy
(http://www.indyproject.org), then the Java code you showed earlier would
translate as the following:
try
{
TStringList *content = new TStringList;
try
{
content->Text = "CREATE TABLE test (`Key_ID` INT(11) NOT NULL)";
IdHTTP1->Request->ContentType =
"application/x-www-form-urlencoded";
IdHTTP1->Post("http://localhost:8084/SiteTracking/SiteTrackerVersionUpdater"
, content);
}
__finally {
delete content;
}
}
catch(const Exception &e)
{
ShowMessage(e.Message);
}
Alternatively:
try
{
TStringStream *content = new TStringStream("CREATE TABLE test
(`Key_ID` INT(11) NOT NULL)\r\n");
try
{
IdHTTP1->Request->ContentType =
"application/x-www-form-urlencoded";
IdHTTP1->Post("http://localhost:8084/SiteTracking/SiteTrackerVersionUpdater"
, content);
}
__finally {
delete content;
}
}
catch(const Exception &e)
{
ShowMessage(e.Message);
}
Gambit
Technical Details
Message-ID:
<44ec896e@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<44eb39e3$2@newsgroups.borland.com> <44eb4100$1@newsgroups.borland.com> <44eb4d5d$1@newsgroups.borland.com> <44eb8380$1@newsgroups.borland.com> <44ec5b63$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: feeec,bfc9e9e4f471e4ee X-Google-Attributes: gidfeeec,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com> Newsgroups: borland.public.cppbuilder.internet.web References: <44eb39e3$2@newsgroups.borland.com> <44eb4100$1@newsgroups.borland.com> <44eb4d5d$1@newsgroups.borland.com> <44eb8380$1@newsgroups.borland.com> <44ec5b63$1@newsgroups.borland.com> Subject: Re: how to send a string to a url Date: Wed, 23 Aug 2006 09:58:17 -0700 Lines: 65 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: <44ec896e@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1156352366 68.69.17.41 (23 Aug 2006 09:59:26 -0700) Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail