Add improved support for HTTP response codes in TG 1.x apps.

Change-Id: I829ab360e13ae88a47e810079c739eac1d925139