How to provide other content-type than text/html with modruby and eruby?

Is it possible to provide a content-type other than text/html using
modruby and eruby?

Currently I cannot make dynamic XML, RDF and XUL using eruby :frowning:

TIA,

Erik.

Erik Terpstra wrote:

Is it possible to provide a content-type other than text/html using
modruby and eruby?

Currently I cannot make dynamic XML, RDF and XUL using eruby :frowning:

Does Apache.request#content_type= do what you want?

http://modruby.net/doc/classes.en.html#label:74

···


([ Kent Dahl ]/)_ ~ [ http://www.pvv.org/~kentda/ ]/~
))_student_/(( _d L b_/ (pre-) Master of Science in Technology )
( __õ|õ// ) )Industrial economics and technological management(
_
/ö____/ (_engineering.discipline=Computer::Technology)

Kent Dahl wrote:

Erik Terpstra wrote:

Is it possible to provide a content-type other than text/html using
modruby and eruby?

Currently I cannot make dynamic XML, RDF and XUL using eruby :frowning:

Does Apache.request#content_type= do what you want?

Probably, but how do I use it?

Do I have to require ‘’ from my eruby script? I am not sure
how this works. Oh well, I probably need to read more docs, or use PHP
for the time being.

Cheers,

Erik.

···

http://modruby.net/doc/classes.en.html#label:74

Kent Dahl wrote:

Erik Terpstra wrote:

Is it possible to provide a content-type other than text/html using
modruby and eruby?

Currently I cannot make dynamic XML, RDF and XUL using eruby :frowning:

Does Apache.request#content_type= do what you want?

Probably, but how do I use it?

Do I have to require ‘’ from my eruby script? I am not sure
how this works. Oh well, I probably need to read more docs, or use PHP
for the time being.

Cheers,

Erik.

···

http://modruby.net/doc/classes.en.html#label:74

Erik Terpstra wrote:

Kent Dahl wrote:

Does Apache.request#content_type= do what you want?

Probably, but how do I use it?

Do I have to require ‘’ from my eruby script? I am not sure
how this works.

Been a while since I last tried it, but if you are running your scripts
under modruby, then it should be accessible to you. Simply:

r = Apache.request
r.content_type = ‘text/html’

…and replace ‘text/html’ with your fancy format.
If you’re using eruby (under modruby), you might have to force the
output of the header. See Apache::Request#send_http_header and
friends. (If you’re using eruby without modruby, then you can ignore
whatever I’ve said.)

Oh well, I probably need to read more docs,

Yup. That was why I included that little clicky. :slight_smile:
Terse, but useful:
http://modruby.net/doc/

HTH

···


([ Kent Dahl ]/)_ ~ [ Kent Dahl - Kent Dahl ]/~
))_student_/(( _d L b_/ (pre-) Master of Science in Technology )
( __õ|õ// ) )Industrial economics and technological management(
_
/ö____/ (_engineering.discipline=Computer::Technology)