Responsável por retornar o body da requisição HTTP
oRest:getBodyRequest()
Nome | Tipo | Descrição |
---|---|---|
cBody | caractere | Conteúdo do Body |
#include "tlpp-core.th" #include "tlpp-rest.th" @Get("/documentation/getBodyRequest") function u_fGetBodyRequest() as logical local cBody := oRest:getBodyRequest() as character local cResp := '' as character cResp := '{' cResp += '"getBodyRequest": ' + if( empty(cBody), 'false', 'true' ) cResp += ',' cResp += '"lenght":' + cValToChar( len(cBody) ) cResp += '}' conout( ' # EndPoint: /documentation/getBodyRequest' ) conout( ' # Body....: ' + cBody ) conout( ' # Response: ' + cResp ) oRest:setKeyHeaderResponse('Content-Type','application/json') oRest:setResponse( cResp ) return .T.
07/2019