However, when I use this code, it says that there is no message in response. Either the sample code is wrong or needs to be updated or I’m doing something wrong.
On a related note, can the response page be expanded to exactly what fields are available? Or are there 2 response objects, one for the callback and one for the response to a http request? In that case, please consider changing the sample code to use something other than response to make it less confusing.
There are two objects. In the case of the httprequest.sendasnyc() callback function, what’s returned is a Squirrel table with the following keys: statuscode, header and body.
This table is not an httpresponse object, which doesn’t have any code-accessible fields other than a header, which has to be set using the httpresponse.header() method.
Because of the confusion that has arisen (understandably) between these two objects, I’ve altered the name of variable passed to the callback in the example code.