genexus

Problem reading data from a web service with Genexus


I'm trying to receive data from a web service. It works in Postman. The only thing I did was set username and password as params and I received a json as response

enter image description here

But when I try to do the same thing in Genexus...

enter image description here

I get this response

enter image description here

The same one I have if I don't pass the user and password parameters into postman. I've tried using other methods instead of AddVariable, but nothing seems to work. What am I doing wrong?


Solution

  • I found the solution: the data should not be passed to it via AddVariable, but via parameters in the URL, like this

    &HttpClient.BaseUrl = "https://api.movimatica.com/rest2/"
&httpClient.Execute('GET','/user/login?username="username"&password=fragola2022')