mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-16 10:39:18 +02:00
* Implemented a HEAD class method
git-svn-id: trunk@23503 -
This commit is contained in:
parent
6d40600ab5
commit
fc68ce2ec5
@ -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.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user