HTTP Status Codes in REALbasic 5.5

I recently wrote a client library that communicates with a RESTful web API in RB 5.5. The only problem I’m running into is I can’t seem to find a way to check the status code returned by the endpoints. Looking at the docs, the HTTPSocket class derives from TCPSocket, which derives from SocketCore. There is an errorCode property and a LastErrorCode property, both of which return SocketCore error constants (which are not HTTP status codes). Likewise, the Error event only passes these same error codes, not the response code. Do any of you fine folks know how to get the HTTP status code from a Get() or Post() request in RB 5.5?

For example, if I make a successful GET request and get the response back, I get the expected payload in the returned string, but then LastErrorCode is set to 102, which indicates the connection closed (which is expected, according to the docs). However, I’m looking for 200 (OK) or 400 (bad request), etc.

I should clarify: I mean when making a synchronous request. Asynchronous request apparently fire the PageReceived event, which has parameters that include the response headers and status code. But I don’t see any way to get the status or response headers for a synchronous request.

Looks like I can make a separate call to GetHeaders() and then parse the status code out of that. That’s unfortunate, but at least it gives me a way forward.