RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
HTTPApp.ExtractHTTPFields Function

Parses a multi-valued string into its constituent fields.

Pascal
procedure ExtractHTTPFields(Separators: TSysCharSet; WhiteSpace: TSysCharSet; Content: PChar; Strings: TStrings; StripQuotes: Boolean = False); overload;
procedure ExtractHTTPFields(Separators: TSysCharSet; WhiteSpace: TSysCharSet; const Content: AnsiString; Strings: TStrings; StripQuotes: Boolean = False); overload;
C++
ExtractHTTPFields(TSysCharSet Separators, TSysCharSet WhiteSpace, const char * Content, TStrings Strings, Boolean StripQuotes = False);
ExtractHTTPFields(TSysCharSet Separators, TSysCharSet WhiteSpace, const AnsiString Content, TStrings Strings, Boolean StripQuotes = False);

ExtractHTTPFields is a general utility to parse multi-valued HTTP header strings into separate substrings.  

Separators is a set of characters that are used to separate individual values within the multi-valued string. 

WhiteSpace is a set of characters that are to be ignored when parsing the string. 

Content is the multi-valued string to be parsed. 

Strings is the TStrings object that receives the individual values that are parsed from Content.  

StripQuotes determines whether the surrounding quotes are removed from the resulting items. When StripQuotes is true, surrounding quotes are removed before substrings are added to Strings.

Note: Characters contained in Separators or WhiteSpace are treated as part of a value substring if the substring is surrounded by single or double quote marks. HTTP escape characters are converted using the HTTPDecode function.
 

 

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