Web.HTTPApp.TAbstractContentParser.CanParse

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

class function CanParse(AWebRequest: TWebRequest): Boolean; virtual;

C++

__classmethod virtual bool __fastcall CanParse(TWebRequest* AWebRequest);

Properties

Type Visibility Source Unit Parent
function public
Web.HTTPApp.pas
Web.HTTPApp.hpp
Web.HTTPApp TAbstractContentParser

Description

Indicates whether a specified request message contains information encoded in a way that this parser understands.

CanParse indicates whether a content parser class can handle parsing a specified request message. CanParse is a class method (Delphi) or static method (C++), which means the Web request does not need an instantiated object to call this method. The Web request object calls the CanParse method of every registered TAbstractContentParser descendant until it finds one that can parse its content.

AWebRequest is the current HTTP request message.

CanParse returns true if this class can parse AWebRequest, false if AWebRequest does not indicate an encoding that this class understands.

In TAbstractContentParser, CanParse always returns false. Descendant classes that implement the GetContentFields and GetFiles methods override CanParse to indicate when a Web request has a format they can parse.

See Also