[progress Communities] [progress Openedge Abl] Forum Post: Re: Parsing An Ihttpresponse

  • Thread starter Thread starter Peter Judge
  • Start date Start date
Status
Not open for further replies.
P

Peter Judge

Guest
By definition properties in interfaces must be public :) You were heading in the right direction though: The Entity property contains the message entity (sometimes called the body; the name 'entity' comes from the RFC2616 spec). Since we don't have generics in the language (yet) it's defined as a P.L.Object and you have to manually cast to an appropriate type. Cast to what, you might be asking around about now. You can check the type of the Entity property via TYPE-OF() or you can use :Entity:GetClass():IsA(). You can also look at the ContentType property which gives you a hint via the MIME type it contains. The Status and StatusCode properties give you the 200 (int) and OK (char) values. Take a look at the GetHeader(s) properties to get the header values. Similarly GetCookie(s) for tasty treats. Some headers have their own properties – ContentType, ContentLength and others - but the values 'behind' are the same as in the headers. In your case, the Entity property will be of type JsonObject . You can always cast to JsonObject or JsonConstruct but that will somewhat depend on how generalised the calling code is (ie how sure are you that you will always get a JSON entity in the body).

Continue reading...
 
Status
Not open for further replies.
Back
Top