HTTP Request - WS REST
Hello Guys,
Can someone help me?
I'm triggering a Rest Services, my JSON is a String variable(Request.JSON), when I pass it on EntityBody.Write, WS returns me the 403 error.
When I pass Obj = {} it responds by saying that no Data has been sent.
So, my problem is to set the "Obj" with the String variable, I should convert it, correct? But how do I do this? My JSON is all in this variable.
MyCode:
Set Dados = ##class(%Net.HttpRequest).%New(),
Dados.Authorization = pBearer _ Request.Token,
Dados.ContentType = "application/json"
$$$TRACE(Dados.Authorization)
Set credential = ##class(Ens.Config.Credentials).%OpenId("demonstracao")
//Set Obj = Request.JSON.%ToStream
Set Obj = Request.JSON
$$$TRACE("Aqui3")
Do Dados.EntityBody.Write(Obj.%ToJSON())
Thanks