User bio
404 bio not found
Member since Jun 10, 2016
Posts:
Replies:
Is it possible?: Yes
Is it a good idea: No
Proof of concept of bad idea:
Class Rest.BadExample Extends %CSP.Page
{
Parameter CHARSET = "utf-8";
Parameter CONTENTTYPE = "application/json";
ClassMethod OnPage() As %Status
{
Set String = "[ {code:1,description:'cat'},{code:2,description:'lyon'}]"
Write String
Quit $$$OK
}
}
As Eduard said, you should make your own class that inherits from
A simple example that you can follow is in the ENSDEMO namespace, the class is Demo.REST.MathService.cls
Certifications & Credly badges:
Gery has no Certifications & Credly badges yet.
Global Masters badges:
Gery has no Global Masters badges yet.
Followers:
Gery has no followers yet.
Following:
Gery has not followed anybody yet.
I have used this in order to call python code in the server, it calls bcrypt encryption in python.
Encriptar Set password = "password" Set tSC = ##class(EnsLib.JavaGateway.Service).RunCommandViaCPIPE("python -c 'import bcrypt; print(bcrypt.hashpw("_$c(34)_password_$c(34)_", bcrypt.gensalt(10)))'",.pDevice,.pOutput) Write pOutput,! Quit