* Implemented a HEAD class method

git-svn-id: trunk@23503 -
This commit is contained in:
michael 2013-01-23 08:52:18 +00:00
parent 6d40600ab5
commit fc68ce2ec5

View File

@ -127,6 +127,8 @@ Type
Procedure FileFormPost(const AURL, AFieldName, AFileName: string; const Response: TStream);
// Simple form of Posting a file
Class Procedure SimpleFileFormPost(const AURL, AFieldName, AFileName: string; const Response: TStream);
// Get HEAD
Class Procedure HEAD(AURL : String; Headers: TStrings);
Protected
// Before request properties.
// Additional headers for request. Host; and Authentication are automatically added.
@ -1159,6 +1161,17 @@ begin
end;
end;
class procedure TFPCustomHTTPClient.HEAD(AURL : String; Headers: TStrings);
begin
With Self.Create(nil) do
try
HTTPMethod('HEAD', AURL, Nil, [200]);
Headers.Assign(ResponseHeaders);
Finally
Free;
end;
end;
end.