Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

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() );


Comment on Re: Re: Re: Handling XML content with HTTP::Daemon
Download Code
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.

    hackmare.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://180589]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (5)
As of 2015-07-04 19:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (60 votes), past polls