Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

Re: Re: Re: Handling XML content with HTTP::Daemon

by Matts (Deacon)
on Jul 09, 2002 at 20:17 UTC ( #180589=note: print w/replies, xml ) Need Help??

in reply to Re: Re: Handling XML content with HTTP::Daemon
in thread Handling XML content with HTTP::Daemon

Ah, HTTP::Daemon expects a result code too. So you need:
$c->send_response( 200, "Content-type: image/svg+xml\r\n\r\n". $svg->xmlify() );

Replies are listed 'Best First'.
Re: Re: Re: Re: Handling XML content with HTTP::Daemon
by hackmare (Pilgrim) on Jul 10, 2002 at 10:00 UTC

    Here was the problem...

    I needed to create an HTTP::Response object explicitly and assign it a return code, content, and header information.

    #new response object with default error values my $response = new HTTP::Response( 404,undef,undef,"404 - Not found." +); #assign values using obvious methods $response->header(Content_Length => $len); $response->header(Content_Type => "image/svg+xml"); $response->content($out); $response->code(200); $c->send_response($response);

    This works now.

    Thanks you all for the help.


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://180589]
[r@j]: I am new to perl script, seeking your advice for the following requirement in perl script - Need to retrieve the status of running process with the process name without using ps -ef command.
[marto]: As discussed yesterday SoPW
[Discipulus]: r@i see perlvar in the docs: $$ is the PID of the current running process. I suppose the name will be perl anyway

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (9)
As of 2017-10-24 07:47 GMT
Find Nodes?
    Voting Booth?
    My fridge is mostly full of:

    Results (286 votes). Check out past polls.