Re: POST results in "HTTP/1.0 (null)" ??

2000-12-21 Thread Doug MacEachern

On Fri, 3 Nov 2000, Paul J. Lucas wrote:

>   So from within a function, I'm doing
> 
>   my $r = Apache::Request->new( Apache->request() );
>   warn "request=", $r->as_string(), "\n";
> 
>   and, when I to a POST request, I get:
> 
> Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
> Content-Length: 6978
> Content-Type: multipart/form-data; boundary=curl3cwvW7Ge8lVBtEGuDRCENOMeIVO
> Host: www.abacus-new.com:80
> Pragma: no-cache
> User-Agent: Mozilla/4.0
> 
> HTTP/1.0 (null)
> 
>   Why is the content merely "HTTP/1.0 (null)"?  What happened to
>   the other 6900 bytes or so?

that's the expected result if you haven't called $r->send_http_header yet.

example:
warn $r->as_string;

$r->send_http_header('text/plain');

print $r->as_string;

the error_log $r->warn output is:
GET /perl/test.pl HTTP/1.0
...

HTTP/1.0 (null)

now that $r->status_line and $r->headers_out have been set by
$r->send_http_header, the $r->print output is:
HTTP/1.0 200 OK
Connection: close
Content-Type: text/plain





Re: $r->param() goes poof (Was: POST results in "HTTP/1.0 (null)")

2000-11-06 Thread G.W. Haywood

Hi there,

On Mon, 6 Nov 2000, Paul J. Lucas wrote:

> From within my authentication handler, I also access query string
> parameters.  When I do this, the downstream content handler finds
> that $r->param() is empty.

Search the Guide for PERL_STASH_POST_DATA.

73,
Ged.




$r->param() goes poof (Was: POST results in "HTTP/1.0 (null)")

2000-11-06 Thread Paul J. Lucas

On Fri, 3 Nov 2000, I wrote:

>   So from within a function, I'm doing
> 
>   my $r = Apache::Request->new( Apache->request() );
>   warn "request=", $r->as_string(), "\n";
> 
>   and, when I to a POST request, I get:
> 
> Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
> Content-Length: 6978
> Content-Type: multipart/form-data; boundary=curl3cwvW7Ge8lVBtEGuDRCENOMeIVO
> Host: www.abacus-new.com:80
> Pragma: no-cache
> User-Agent: Mozilla/4.0
> 
> HTTP/1.0 (null)

I made a much smaller test case that works fine.  I've since
discovered that the difference between the case that doesn't
work and the case that does is the one that doesn't also
includes and authentication handler in its  section.

From within my authentication handler, I also access query
string parameters.  When I do this, the downstream content
handler finds that $r->param() is empty.  If I have my
authentication handler not touch $r->param(), then the
downstream content handler properly gets the parameters.

Why does accessing $r->param() from within an authentication
(or, generally, and upstream handler) blow them away for
downstream handlers?

- Paul




Re: POST results in "HTTP/1.0 (null)" ??

2000-11-04 Thread Paul J. Lucas

On Sat, 4 Nov 2000, G.W. Haywood wrote:

> On Fri, 3 Nov 2000, Paul J. Lucas wrote:
> 
> > Why is the content merely "HTTP/1.0 (null)"?  What happened to
> > the other 6900 bytes or so?
> 
> Maybe you need to generate them...

I did: if you read my original post, I wrote:

Orig>   If I write a mini server in Perl that just dumps the contents
Orig>   of the HTTP post, the posted data is correct.

I'm doing a POST with curl: the data curl generates is fine as
is in evidence by the above mini server.

> do you think you could give us a bit more to go on?

I'd be happy to: what else would you like to know?

- Paul




Re: POST results in "HTTP/1.0 (null)" ??

2000-11-04 Thread G.W. Haywood

Hi there,

On Fri, 3 Nov 2000, Paul J. Lucas wrote:

> Why is the content merely "HTTP/1.0 (null)"?  What happened to
> the other 6900 bytes or so?

Maybe you need to generate them... do you think you could give us a
bit more to go on?

73,
Ged.





POST results in "HTTP/1.0 (null)" ??

2000-11-03 Thread Paul J. Lucas

So from within a function, I'm doing

my $r = Apache::Request->new( Apache->request() );
warn "request=", $r->as_string(), "\n";

and, when I to a POST request, I get:

Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
Content-Length: 6978
Content-Type: multipart/form-data; boundary=curl3cwvW7Ge8lVBtEGuDRCENOMeIVO
Host: www.abacus-new.com:80
Pragma: no-cache
User-Agent: Mozilla/4.0

HTTP/1.0 (null)

Why is the content merely "HTTP/1.0 (null)"?  What happened to
the other 6900 bytes or so?

If I write a mimi server in Perl that jsut dumps the contents
of the HTTP post, the posted data is correct.

- Paul