RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TContentParser.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; override;
C++
virtual __fastcall Boolean CanParse(TWebRequest AWebRequest);

CanParse indicates whether a content parser class can handle parsing a specified request message. CanParse is a static class method, 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 content parser 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 TContentParser, CanParse always returns true. TContentParser is always the last content parser that the Web request object checks, and provides the default parsing when no other parser is available. 

 

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