FWHttpHeaderResponseParser
Interprets an HTTP response header.
Overview
This helper is coupled to FWHttpHeaderResponse and documented as unsuitable for standalone use. New/Parser signatures repeat the owner class name, an inconsistency requiring source verification before direct invocation. This adaptation uses public FWHttpHeaderResponse:Activate without constructing the parser directly. cCodErr/Error are named diagnostics without invented formats or codes. (Sources: refs. 1–2.)
Methods
FWHttpHeaderResponse:ActivateParses through the owner object.oResponse:Activate(cHeader)
FWHttpHeaderResponse:GetStatusCodeReads status as text.oResponse:GetStatusCode() --> cStatus
FWHttpHeaderResponse:DeActivateReleases activated state.oResponse:DeActivate()
Commented example
#Include "Protheus.ch"
User Function Ed430()
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.