Question Guillaume Lepretre · May 14, 2018

Get request header (REST API)

Hello,

In all web services, i need to my get login and token. So with Postman, i tried to call a HTTP request where I put the login/token in the header :

 

I tried to get data from Http request header. The REST APi use %CSP.REST. I tried something like that : 

But it didn't work..

Someone can give me some example or other method ?

Regards,

Comments

PILAR GUERRERO · May 14, 2018

Hi,

You can do it as in any CSP page/class. With %request, which is object of class %CSP.Request

And headers available in property CgiEnvs, where every http header appear with a prefix HTTP_

try that better

set login = %request.GetCgiEnv("HTTP_LOGIN")
0
Guillaume Lepretre  May 14, 2018 to PILAR GUERRERO

It works ! I tried this method before but I failed cuz it was in lower case...

Really thank you

0