thank's for your back, i'm blocked on the authentification request , i want to extract user name , mail and password from the http request , after i send these parameters to my function in rest class.
So I think you're encoding it as an Authorization Header?
In that case, you can extract this from
set Auth = %request.GetCgiEnv("HTTP_AUTHORIZATION")
then process this however you need to (for example if you have something like "Basic 123908109abc", this will unpack it and decode the Base64)
set AuthType = $P(Auth," ",1) set AuthString = $P(Auth," ",2) set DecodeAuthString = $SYSTEM.Encryption.Base64Decode(AuthString) set userid = $p(DecodeAuthString,":",1) set token = $p(DecodeAuthString,":",2)
Hi Sofiane
I'm assuming you want to read this from a JSON payload. You can follow the instructions in https://community.intersystems.com/post/lets-write-angular-1x-app-cach%C... to implement a fromJSON method, after reading the payload from the HTTPRequest
HTH
Chris
Hi Chris
for the GET method , it's comming from my IHM , it's not in json form, you that i convert it into json form first?
thank's
HI Soufiane
I'd need more info about the format of the data and how you are sending it to comment any further
Hi Chris
thank's for your back, i'm blocked on the authentification request , i want to extract user name , mail and password from the http request , after i send these parameters to my function in rest class.
thank's
So I think you're encoding it as an Authorization Header?
In that case, you can extract this from
then process this however you need to (for example if you have something like "Basic 123908109abc", this will unpack it and decode the Base64)
set AuthString = $P(Auth," ",2)
set DecodeAuthString = $SYSTEM.Encryption.Base64Decode(AuthString)
set userid = $p(DecodeAuthString,":",1)
set token = $p(DecodeAuthString,":",2)
thank you very much Chris
Social networks
InterSystems resources
Log in or sign up
Log in or create a new account to continue
Log in or sign up
Log in or create a new account to continue
Log in or sign up
Log in or create a new account to continue