Hi
I'm trying to send a request to a REST API Service.
I'm using this code (Adapter is
{
set tSC = $$$OK
try
{</p>
set tContent="application/json"
set tApiKey="somekey"</p>
Set tOut=##class(%IO.StringStream).%New()
set tSC= ..ObjectToJSONStream(pRequest,.tOut)
If $$$ISERR(tSC)&&$IsObject(tHttpResponse)&&$IsObject(tHttpResponse.Data)&&tHttpResponse.Data.Size {
Set tSC=$$$ERROR($$$EnsErrGeneral,$$$StatusDisplayString(tSC)_":"_tHttpResponse.Data.Read())
}
Quit:$$$ISERR(tSC)
}
catch
{
Set tSC=$$$SystemError
}
quit tSC
}
</p>
but I got a missing message alert from the REST Service
Also, I tried with this set tFormVar="Content-Type,apikey,cur" but I got a duplicate apikey message.
This is the right way to send a header and body to a PUT operation in REST API?
Thanks & Best Regards
Sergio
</body></html>