Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Determine GET or POST from Indy HTTPServerCommandGet?

194 views
Skip to first unread message

Kim Berry

unread,
Jun 4, 2001, 3:09:34 PM6/4/01
to
I am building a server using the Indy /HTTPServer code as a starting
point in Delphi 5. I need to know whether the TIdHTTPRequestInfo
is from a GET or POST. My guesses have been:

1. Event-based:

HTTPServer.OnCommandGet event if from GET
HTTPServer.OnCommandOther event if from POST

2. Embedded in the TIdHeaderList (in which case I'm confused without
some example code on how to extract it.)

Also, if it was from a POST, will the form's fields be contained in
"TIdHTTPRequestInfo.Document"? If not, where do I get them? (I assume
"TIdHTTPRequestInfo.Params.Text" only contains queryString args.)

Thanks,
Kim
------------------------
Kim Berry - kbe...@prestwood.com
Prestwood Software & Consulting
http://www.prestwood.com

Don Siders - Team Indy

unread,
Jun 4, 2001, 3:46:38 PM6/4/01
to

"Kim Berry" <k...@prestwood.com> wrote in message news:3b1bdc06$1_2@dnews...

> I need to know whether the TIdHTTPRequestInfo
> is from a GET or POST.

Check the TIdHTTPRequestInfo.Command property.

> Also, if it was from a POST, will the form's fields be contained in
> "TIdHTTPRequestInfo.Document"?

No. Document is the filename and extension part of the URI parsed from the
command received by the server.

> If not, where do I get them? (I assume
> "TIdHTTPRequestInfo.Params.Text" only contains queryString args.)

Params would be the place to find URL-encoded values in a Post method. For
form-encoded values, use
TIdHTTPRequestInfo.Session.Content.

hth...

Don


Kim Berry

unread,
Jun 4, 2001, 8:26:48 PM6/4/01
to
Thanks Don - it's working great.

One note, I had better luck getting the "form-encoded"param string with
"RequestInfo.UnparsedParams" than with "RequestInfo.Session.Content.Text."
If I'm off base please let me know.

Thanks,
Kim

"Don Siders - Team Indy" <sid...@att.net> wrote in message
news:3b1be5bb$1_1@dnews...

Thomas Wegner

unread,
Jun 5, 2001, 2:56:30 AM6/5/01
to
Who i can get the content of POST when server
not work session-based (SessionState := False)?
------------------------------------------------
Thomas Wegner

0 new messages