HTTP/1.0 200 OK Content-type: text/html <HTML> ...HTML content here. </HTML>
This method adds this ContentType header to a request. This method is also called internally by various other methods that manipulate the HTTP header. HTMLHeader() and any full page generation methods such as ExpandTemplate(), ExpandScript(), ErrorMsg() and StandardPage() pass forward their lvHeader parameter to this method.
o.ContenttypeHeader([loHTTPHeader | lcContentType], llNoOutput)
Common types are:
"text/html" - Default
"text/xml" - XML
"text/plain" - Text data
"Force Reload" - Force browser to always reload page
"Cache" - Maximum Cache Settings for this request
"none" - No header is sent - your code has to set it up
oHTTPHeader
A preconfigured wwHTTPHeader object that was previously set up and configured.
llNoOutput
Optional - Output to string and not to HTTP stream when set to .t..
**** Simple Content Type Assignment on XML data
lcXML = oXML.CursorToXML()
Response.ContentTypeHeader("text/xml")
Response.Write(lcXML)
RETURN
**** HTTP Header object ****
lcId=Request.GetCookie("WWUSERID")
*** Create Standard Header - here to add an HTTP Cookie
loHeader=CREATEOBJECT("wwHTTPHeader")
loHeader.DefaultHeader()
*** If not Found
IF EMPTY(lcId)
*** Create the cookie
lcId=SYS(3)
loHeader.AddCookie("WWUSERID",lcId,"/wconnect")
ENDIF
*** Set the Content Type Header
Response.ContentTypeHeader(loHeader)
*** Alternately you can also pass the header to another method
* Response.HTMLHeader("Cookie Test","Cookie Test Page",,loHeader)
*** Followed by regular HTML text (any wwResponse methods valid)
Response.Write("<HTML><BODY>")
Response.Write("Cookie Value (wwUserId): <b>" +lcId +"</b><p> ")
Response.Write("</BODY></HTML>")
RETURN