Question Soufiane Amroun · Oct 27, 2017

extract data from http get method

Hi team,

i send an http request to my rest class, i want to extract ID , full name , pass word from this request , can you show me how doing it.

thank's

Comments

Soufiane Amroun  Oct 27, 2017 to Chris Stewart

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

0
Chris Stewart  Oct 27, 2017 to Soufiane Amroun

HI Soufiane

I'd need more info about the format of the data and how you are sending it to comment any further

0
Soufiane Amroun  Oct 27, 2017 to Chris Stewart

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  

0
Chris Stewart  Oct 27, 2017 to Soufiane Amroun

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)

0