Zum Hauptinhalt springen

ResponseBodyAsTextWithType

Structure

ResponseBodyAsTextWithType(sValue, sContentType)

Parameters

| Parameter | Type | Description
| sValue | String | the message body of the response, as textsContentType | String | the content-type value that should be set in response header (based on type of text) |

Return Value

String

Description

Use this function to set a web response message body as text - but with a specific content-type. Important: Set any headers (ResponseHeader) and set the status code (ResponseStatusCode) BEFORE you set the message body response using either ResponseBodyAsText or ResponseBodyAsFile. Note that ResponseBodyAsText function can be used if the 'content-type' header in the web response is simply 'text/plain'.

Example

ResponseStatusCode(700)

ResponseBodyAsTextWithType("<?xml version=""1.0"" encoding=""UTF-8"" ?>" & Chr(13) &

"<Event>" & Chr(13) &

" <Result>SUCCESS</Result>" & Chr(13) &

" <Note>Event Created</Note>" & Chr(13) &

"</Event>", "application/xml")

Response |