Usina BRAdvPL Guide
Sign in
← All topics
CLASSUnder review

FWHttpHeaderResponse

FWHttpHeaderResponse():New()

Interprets an HTTP response header.

FWHttpHeaderResponseAdvPL
01 · OVERVIEW

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.)

02 · SYNTAX

Syntax

FWHttpHeaderResponse():New()

Methods

ActivateParses through the owner object.oResponse:Activate(cHeader)
GetStatusCodeReads status as text.oResponse:GetStatusCode() --> cStatus
DeActivateReleases activated state.oResponse:DeActivate()
03 · PRACTICAL EXAMPLE

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 Nil
Expected result

Expected text code: 204; no HTTP request. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

BEST PRACTICES
  • 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.

Related content

REFERENCES
  1. TOTVS. FWHttpHeaderResponse. TDN. Accessed on 2026-10-27.
Status
Under review
Page created on
Last reviewed on
Original language
Portuguese
Reviewed by
Usina.BR
0 approved comment(s)

Comments

There are no approved comments yet.

Sign in with Google or Microsoft to comment.

Powered by Usina Docs · Alpha