RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TAbstractContentParser.CanParse Method

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

Pascal
class function CanParse(AWebRequest: TWebRequest): Boolean; virtual;
C++
virtual __fastcall Boolean CanParse(TWebRequest AWebRequest);

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. 

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!