That is very helpful. I wasnt aware of this class method or class. Thank you for your assistance. I will use it and let you know if  i encounter any issue.

I also tried using another method where i read the stream object using ReadLine.

Then if the string starts with "MSH" OR "FT1" i increment the count.

In that case i have to use the Terminator character as $C(10) or $C(13) 

Regards,

Jimmy Christian.

The issue is the API  is not set up yet on the project which i am working.

But the specs has the JSON PAYLOAD as request and then the response is what i pasted above. 

So i am trying to get the code ready to parse in the meantime until the API is set up. Hopefully i will have something to work with POSTMAN as soon as API is set up.

Once i receive the response , i need to parse it for any error and then shutdown the operation.  At the most i can convert the response to string and check for error.

Cache for Windows (x86-64) 2018.1.1 (Build 312_1_18937U) Fri Apr 26 2019 17:58:36 EDT

I tried dynamic objects but gives me an error, unless i am not doing it correctly or if syntax is not correct.

Set objStream = objHttpResponse.Data
     Set json =""
     While ('objStream.AtEnd) {
          Set json = json _ objStream.ReadLine()
  
     }

set iter = json.%FromJSON().%GetIterator()
   while iter.%GetNext(.key , .value )
      {
       write "key = "_key_" , value = "_value,!
             }

Good Morning Danny,

I appreciate your help. After  changing the names i was able to  make the POST calls using SEND. Worked perfectly ! Thank you for your time.

Yes,  looks like .Send has some more configurable parameters in the HttpRequest object we send.

In the same context, would you be able to know how to set a Basic Authoriztion using User and Pass while making the call ?

Seems like i have to make Credentials using ENSEMBLE.

Than set the httprequest.username and httprequest.password using that credential object.

Please let me know if you have any information.

Thank you for time.

Regards,

Jimmy Christian.

Thank you Danny for help.

Yes this worked. I did not create a seperate HttpRequest but just used the PostURL method as below.

Set tSC=..Adapter.PostURL(tURL,.tHttpResponse,,pRequest1.%ToJSON()).

The code you provided is very helpful. Especially when i have to include the content type while making the http request.

The Adapter object does not have that ContentType property.

By the way i am also trying to understand when to use the PostURL or .Send or  SendFormDataArray method to make a http request?

Do they provide same functionality ? If you have information and can provide me will be much appreciated.

Thank you

Jimmy Christian.