Published on InterSystems Developer Community (https://community.intersystems.com)

Home > 2017 ensemble POST not working and not giving any error

Question
prashanth ponugoti · Dec 2, 2021

2017 ensemble POST not working and not giving any error

I am totally struck and last 3 days I am not able to progress much. Here I need to call POST method in REST endpoint in Business Operation.

Please find the code below, which is working fine in IRIS 2020.1 but not in cache 2017.

$$$LOGINFO("InvokeTokenAPI...")
try
{
Set httpRequest= ##class(%Net.HttpRequest).%New()
Set httpRequest.Server = ..Adapter.HTTPServer
Set httpRequest.Location = ..Adapter.URL
Set httpRequest.SSLConfiguration = ..Adapter.SSLConfig Set httpRequest.Https = $$$YES
Set httpRequest.ContentType = "application/x-www-form-urlencoded" do httpRequest.InsertFormData("grant_type", pRequest.grantType)
do httpRequest.InsertFormData("username", pRequest.username)
do httpRequest.InsertFormData("password", pRequest.password) Set sc = httpRequest.Post("", 2) $$$LOGINFO("post"_httpRequest.HttpResponse)
}
catch ex
{
$$$LOGINFO("Exception:" _ex) }
 

This code is working fine and giving the resonse in  IRIS2020.1 in mylocal. Same code is not working in cache 2017.

Could you please suggest change to make it work in cache 2017,.

Thanks,

Prashanth

#REST API #Ensemble
Product version: Caché 2017.1

Source URL:https://community.intersystems.com/post/2017-ensemble-post-not-working-and-not-giving-any-error