[aida] Returning content of different types (was How to download a stream)
herbertkoenig at gmx.net
Tue Oct 5 22:16:38 CEST 2010
thanks, it helped. And I found the class comment of WebNonHTMLResource
which explained why my downloads still started with a html extension.
Herbert mailto:herbertkoenig at gmx.net
JM> Hi Herbert,
JM> A bit but hope not too late answer:
JM> Returning an answer in a content type other that HTML is actually pretty
JM> simple. Let me explain with example returning an XML:
JM> 1. make a new class, say XMLContent as subclass of WebElement
JM> 2. ovveride method #aidaContentType to return appropriate content type:
JM> | xml |
JM> xml := '<xml>some XML content</xml>.
JM> e := XMLContent new.
JM> e addText: xml.
JM> 4.in browser open something like:
JM> To explain a bit: if App view method return an element with content type
JM> different than default, this content type will be set in a header of
JM> response to your web request. This way we can very simply return content
JM> in any content type we like, like XML, CVS, JPG etc.
JM> I put this explanation on our website in FAQ too:
JM> Best regards
More information about the Aida