Board index » cppbuilder » Indy POST-ing Empty Parameters?

Indy POST-ing Empty Parameters?


2005-07-16 01:24:45 AM
cppbuilder47
Hi All,
I try to post data on a web site, and for some reason the server reject my
post (internal server error 500). I used a sniffer and I can compare the
data sent by Internet Explorer and I notice it contains some empty
variables.
I tried to send the variables from Indy like this:
ParamData->Values->["MyVariable"] = "";
but Indy actually doesn't send "MyVariable" at all if it sees it is empty.
Is there a way of "convincing" Indy to send it anyway?
I use Indy 9.0.17, if that matters.
Any response appreciated.
Regards,
Nicolae
 
 

Re:Indy POST-ing Empty Parameters?

"Nicolae Fieraru" < XXXX@XXXXX.COM >wrote in message
Quote
I try to post data on a web site, and for some reason the server reject my
post (internal server error 500). I used a sniffer and I can compare the
data sent by Internet Explorer and I notice it contains some empty
variables.
Please show your actual code, and the actual data that both Indy and IE are
sending.
Quote
I tried to send the variables from Indy like this:

ParamData->Values->["MyVariable"] = "";

but Indy actually doesn't send "MyVariable" at all if it sees it is empty.
Assigning an empty string to a TStrings class via the Values[] property
removes that value from the list. That is a Borland idiom, not an Indy one.
If you need to send blank values, then you need to use the Add() or Insert()
method instead of Values[], ie:
ParamData->Add("MyVariable=");
Gambit
 

Re:Indy POST-ing Empty Parameters?

Quote
Please show your actual code, and the actual data that both Indy and IE
are
sending.
Hi Remy,
Thank you very much for your support. The question I had was only related
with posting the empty variables, and your advice, to use
ParamData->Add("MyVariable=");
worked as expected.
Best wishes,
Nicolae
Quote
Assigning an empty string to a TStrings class via the Values[] property
removes that value from the list. That is a Borland idiom, not an Indy
one.
If you need to send blank values, then you need to use the Add() or
Insert()
method instead of Values[], ie:

ParamData->Add("MyVariable=");


Gambit


 

{smallsort}