wwRestProcess::lRawResponse

Determines whether the current requests returns a raw response result rather than a JSON response.

If .T. the result from the method is not converted to JSON. Instead you are expected to use the Response object to create your HTTP output directly into the Response stream.

Please see Sending raw, non-JSON Response results with a REST method for more information.

o.lRawResponse

Remarks

This property acts as a proxy for wwJsonService::IsRawResponse.

Example

FUNCTION ReturnPdf()

THIS.lRawResponse = .T.
Response.ContentType = "application/pdf"

 lcFilename = THIS.ResolvePath("~/policy.pdf") 

*** Send from memory - string/blob
lcFile = FILETOSTR(lcFilename)
Response.BinaryWrite( lcFile )

*** OR: Send from file
*!* Response.TransmitFile(lcFilename,"application/pdf")

ENDFUNC

See also:

Class wwRestProcess | wwJsonService::IsRawResponse | Sending raw, non-JSON Response results with a REST method

© West Wind Technologies, 1996-2024 • Updated: 04/22/24
Comment or report problem with topic