FWHttpHeaderResponse
FWHttpHeaderResponse():New()Interprets an HTTP response header.
Overview
Represents response headers, keeping parsed fields in aHeaderFields. GetStatusCode returns text: compare with "204" rather than assuming a number. GetReason returns the reason; its cleanup description appears copied from DeActivate, so the documented return/example guide interpretation. A synthetic header avoids network access and demonstrates no real request success. (Sources: refs. 1–1.)
Syntax
FWHttpHeaderResponse():New()Methods
ActivateParses through the owner object.oResponse:Activate(cHeader)
GetStatusCodeReads status as text.oResponse:GetStatusCode() --> cStatus
DeActivateReleases activated state.oResponse:DeActivate()
Commented example
#Include "Protheus.ch"
User Function Ed429()
Local oResponse := FWHttpHeaderResponse():New()
Local cHeader := "HTTP/1.1 204 No Content" + Chr(13)+Chr(10) + "Content-Length: 0" + Chr(13)+Chr(10)+Chr(13)+Chr(10)
// Synthetic input without HttpGet or credentials.
oResponse:Activate(cHeader)
ConOut(oResponse:GetStatusCode())
oResponse:DeActivate()
FreeObj(oResponse)
Return NilExpected text code: 204; no HTTP request. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.
- Check LIB version, lifecycle and context before integration. These methods are a documented subset rather than the complete API.
- Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

Comments
There are no approved comments yet.
Sign in with Google or Microsoft to comment.