From RAD Studio API Documentation
Jump to: navigation, search


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


__classmethod virtual bool __fastcall CanParse(TWebRequest* AWebRequest);


Type Visibility Source Unit Parent
function public
Web.HTTPApp TAbstractContentParser


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