Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^4: Changing the content type

by friedo (Prior)
on Jul 15, 2008 at 20:32 UTC ( #697799=note: print w/replies, xml ) Need Help??


in reply to Re^3: Changing the content type
in thread Changing the content type

To add to Fletch's (rather unnecessarily vociferous) correction, the right way to do it is to pass both arguments to header at the same time.
print $q->header(-type => 'text/xml', -attachment => 'filename.xml');
If you're using a framework like CGI::Application, there are utility methods for keeping track of multiple headers and outputting them exactly once, so you don't have to keep track of lots of print statements and won't accidentally print two sets of headers.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://697799]
help
Chatterbox?
[Discipulus]: are you using Prima Corion? good morning Corion and ambrus, btw
[Corion]: Discipulus: Yeah, I rediscovered it when I wanted to have a simple (cross-platform) wrapper for my OpenGL program so it has a nice window etc
[Corion]: ... and one thing leads to another, so ambrus provided the integration with AnyEvent so I can now conveniently make HTTP requests from that app too :)

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (8)
As of 2016-12-09 09:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (150 votes). Check out past polls.