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

mtGet / mtPost question

36 views
Skip to first unread message

Stephen Bertram

unread,
Aug 1, 2000, 3:00:00 AM8/1/00
to
I have just installed a standard CGI app on a new IIS 4 server and have a
problem with forms - anything using mtGet sends all parameters correctly via
QueryFields, but as soon as it is changed to mtPost no parameters are found
in ContentFields.

Are there any IIS settings which affect mtPost ?????

TIA

Stephen Bertram

Ronaldo Melo Ferraz

unread,
Aug 1, 2000, 3:00:00 AM8/1/00
to
That is Delphi's intended behavior. GET and POST encode parameters in
different ways. GET uses the URL to pass its parameters while POST puts its
parameters in the request contents. Delphi parses both the URL and the
content (if it's a POST request) and puts the parameters passed in the URL
in Request.QueryFields and the parameters passed in the content body in
Request.ContentFields.

--
Ronaldo Ferraz
(Do not email me directly unless asked)

"Stephen Bertram" <step...@timedisciple.com> wrote in message
news:8m51cv$so...@bornews.borland.com...

Stephen Bertram

unread,
Aug 2, 2000, 3:00:00 AM8/2/00
to
Thanks Ronaldo - I KNOW that and the app is coded to read the request
contents if the method is mtPost.

if (Request.MethodType = mtGet) or ((Request.MethodType = mtAny) and
(Request.method = 'GET')) then
req.commatext := Request.QueryFields.commatext
else
req.commatext := Request.ContentFields.commatext;

This app works on all other servers I've run it on - the same client gets
the correct response from the app on one server while on the problem server
the request contents are reported as nil.

Any ideas ??

Stephen


Ronaldo Melo Ferraz <NsOhSe...@taskmail.com.br> wrote in message
news:8m7qbm$qp...@bornews.borland.com...

Ronaldo Melo Ferraz

unread,
Aug 2, 2000, 3:00:00 AM8/2/00
to
Sorry for misunderstanding you. I confess I'm a little confused here.
Quoting from your email: "anything using mtGet sends all parameters

correctly via QueryFields, but as soon as it is changed to mtPost no
parameters are found in ContentFields". What is anything? An action?

--
Ronaldo Ferraz
(Do not email me directly unless asked)
"Stephen Bertram" <step...@timedisciple.com> wrote in message

news:8m7spu$qp...@bornews.borland.com...

Stephen Bertram

unread,
Aug 3, 2000, 3:00:00 AM8/3/00
to
Sorry Ronaldo - I should have made it clear.

Using the CGI code in the previous post to receive the data fields posted
from a form, I normally can change the method in the <FORM..> tag from GET
to POST with no problem - the CGI app uses QueryFields or ContentFields
depending on the Request.MethodType. My HTML is normally coded to use the
POST method for 2 reasons - the location edit box is tidier and it allows
transfers of string data > 255 characters.

On all but 1 of the servers this app is installed on this works perfectly.
On this one server, data is received only when the form method is GET.

A test HTML form like demonstrates this problem :

<HTML><BODY>
<FORM ACTION="/cgi-bin/td.cgi" METHOD="GET">
<INPUT TYPE="HIDDEN" NAME="DATA_PAGE" VALUE="TEST_PAGE">
Enter Data Here <INPUT TYPE="TEXT" NAME="DATA_FIELD" SIZE="20">
<br>&nbsp;<br>
and Click Here <INPUT TYPE="SUBMIT">
</FORM>
</BODY></HTML>

That always works. Change the GET to POST and it works on all but 1 of my
installations. On that server using POST results in
Request.ContentFields.count = 0.

I'm stumped.

Stephen


Ronaldo Melo Ferraz

unread,
Aug 4, 2000, 3:00:00 AM8/4/00
to
"Stephen Bertram" <step...@timedisciple.com> wrote in message
news:8ma3b6$ga...@bornews.borland.com...

> That always works. Change the GET to POST and it works on all but 1 of my
> installations. On that server using POST results in
> Request.ContentFields.count = 0.
I didn't investigate further but it seems to be really a problem with the
server since the application works in other servers. BTW, when
Request.ContentFields.Count turns to be zero, does Request.QueryFields
contain the missing fields?

You can use do the following to get all fields without having to resort to
Request.MethodType:

MyHTTPFields.AddStrings(Request.ContentFields);
MyHTTPFields.AddStrings(Request.QueryFields);

Stephen Bertram

unread,
Aug 7, 2000, 3:00:00 AM8/7/00
to
Thanks Ronaldo - I never thought of making the query and content fields
additive.

I still haven't figured out what the server is doing :-( but I will rebuild
it from scratch as soon as I can get access.

Stephen
Ronaldo Melo Ferraz <NsOhSe...@taskmail.com.br> wrote in message

news:8megia$n...@bornews.borland.com...

Ronaldo Melo Ferraz

unread,
Aug 7, 2000, 3:00:00 AM8/7/00
to
"Stephen Bertram" <step...@timedisciple.com> wrote in message
news:8mkm0m$n3...@bornews.borland.com...

> Thanks Ronaldo - I never thought of making the query and content fields
> additive.
I use that all the time. Most of my code is supposed to work both from forms
and links so centralizing the fields saves a lot of time.

> I still haven't figured out what the server is doing :-( but I will
rebuild
> it from scratch as soon as I can get access.

I have worked with IIS almost daily for the past 3 years. I've seen so many
strange things that I will not be suprised at all if the problem goes way
with a fresh installation.

0 new messages