Help testing post response

J

Jim Simpson

I'm trying to test a post response as follows:
<<<<<<<<<<<<<<<
my $csvresponse = $ua->post($https_downmngrform, [ "$https_name1" =>
"$https_value2", "$https_name2" => "$https_value1", 'Download' => 'Download
Data' ] );
if ($csvresponse->is_success())
{
print "is_success" . ", " ;
}
<<<<<<<<<<<<<<<<
My problem is that it indicates success even though the result is not what I
want. It also indicates success when I substitute a nonsensical string for
one of the values. Can someone suggest what might be a problem.

Thanks,

Jim
 
T

Tad McClellan

Jim Simpson said:
I'm trying to test a post response as follows:
<<<<<<<<<<<<<<<
my $csvresponse = $ua->post($https_downmngrform, [ "$https_name1" =>
^ ^
^ ^
"$https_value2", "$https_name2" => "$https_value1", 'Download' => 'Download
^ ^ ^ ^ ^ ^
^ ^ ^ ^ ^ ^
Data' ] );


perldoc -q vars

What's wrong with always quoting "$vars"?

if ($csvresponse->is_success())
{
print "is_success" . ", " ;
}
<<<<<<<<<<<<<<<<
My problem is that it indicates success even though the result is not what I
want. It also indicates success when I substitute a nonsensical string for
one of the values. Can someone suggest what might be a problem.


The resource you are talking to isn't playing nicely. (ie. it is broken)
 
J

Jim Simpson

Tad,
I don't understand your response. Could you be a little more descriptive for
me?
Jim


Tad McClellan said:
Jim Simpson said:
I'm trying to test a post response as follows:
<<<<<<<<<<<<<<<
my $csvresponse = $ua->post($https_downmngrform, [ "$https_name1" =>
^ ^
^ ^
"$https_value2", "$https_name2" => "$https_value1", 'Download' =>
'Download
^ ^ ^ ^ ^ ^
^ ^ ^ ^ ^ ^
Data' ] );


perldoc -q vars

What's wrong with always quoting "$vars"?

if ($csvresponse->is_success())
{
print "is_success" . ", " ;
}
<<<<<<<<<<<<<<<<
My problem is that it indicates success even though the result is not what I
want. It also indicates success when I substitute a nonsensical string for
one of the values. Can someone suggest what might be a problem.


The resource you are talking to isn't playing nicely. (ie. it is broken)
 
T

Tad McClellan

[ Please learn how to properly compose a followup posting.
Have you seen the Posting Guidelines that are posted here frequently?
Text rearranged into a more conventional order (ie. chronological).
]


Jim Simpson said:
Tad McClellan said:
Jim Simpson said:
I'm trying to test a post response as follows:
<<<<<<<<<<<<<<<
my $csvresponse = $ua->post($https_downmngrform, [ "$https_name1" =>
^ ^
^ ^
"$https_value2", "$https_name2" => "$https_value1", 'Download' =>
'Download
^ ^ ^ ^ ^ ^
^ ^ ^ ^ ^ ^
Data' ] );


perldoc -q vars

What's wrong with always quoting "$vars"?


You do not need any of those underlined quote characters:

my $csvresponse = $ua->post($https_downmngrform, [ $https_name1 =>
$https_value2, $https_name2 => $https_value1, ...


will work fine.

"perldoc -q" is how you look up a Perl Frequently Asked Question.

I don't understand your response. Could you be a little more descriptive for
me?


If the resource that you are communicating with reports success
when it failed, then it contains a bug, ie. it is broken.
 
J

Jim Simpson

Tad McClellan said:
[ Please learn how to properly compose a followup posting.
Have you seen the Posting Guidelines that are posted here frequently?
Text rearranged into a more conventional order (ie. chronological).
]


Jim Simpson said:
Tad McClellan said:
I'm trying to test a post response as follows:
<<<<<<<<<<<<<<<
my $csvresponse = $ua->post($https_downmngrform, [ "$https_name1" =>
^ ^
^ ^
"$https_value2", "$https_name2" => "$https_value1", 'Download' => 'Download
^ ^ ^ ^ ^ ^
^ ^ ^ ^ ^ ^
Data' ] );


perldoc -q vars

What's wrong with always quoting "$vars"?


You do not need any of those underlined quote characters:

my $csvresponse = $ua->post($https_downmngrform, [ $https_name1 =>
$https_value2, $https_name2 => $https_value1, ...


will work fine.

"perldoc -q" is how you look up a Perl Frequently Asked Question.

I don't understand your response. Could you be a little more descriptive for
me?


If the resource that you are communicating with reports success
when it failed, then it contains a bug, ie. it is broken.

Thanks Tad for your help.

Jim
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

traffic control question 1
Need help with this code 2
Post to https using perl script 7
LWP Post 2
LWP credentials help 2
Trouble accessing a value within a JSON string. 1
Help me to Improve 11
Registration Form 7

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top