I've got a call that looks like so:
oResponse = ClientBuilder :Build() :Client :Execute(oRequest) .
oResponse is an instance of an IHttpResponse interface. I expect it to have a payload that looks something like this:
201:
Created
Content-Type:
application/json
Location:
localhost:7474/.../9
{ "commit" : "localhost:7474/.../commit", "results" : [ { "columns" : [ "n" ], "data" : [ { "row" : [ { "name" : "My Node" } ] } ] } ], "transaction" : { "expires" : "Wed, 13 Jan 2016 00:00:00 +0000" }, "errors" : [ ] }
Problem is - I can't find any docs on how to get the payload / header out of the oResponse object instance. Looking at https://documentation.progress.com/output/oehttpclient/index.html I see an "Entity" property - that's protected, so I can't get to it .
How should I proceed?
Thanks Shelley!
Agreed on the public property interfaces - so I'm thinking the docs that list it as protected is error, or the entity property isn't part of the interface.
Based on what you wrote I was able to get the data where it belonged, and this is the result:
oJsonObject = CAST(oResponse:Entity, JsonObject). ASSIGN chCommit = oJsonObject:GetCharacter("commit") oResultArray = oJsonObject:GetJsonArray("results") oTransJson = oJsonObject:GetJsonObject("transaction") oJsonErrorArray = oJsonObject:GetJsonArray("errors") .
Thx!