TMVCRESTClient compatibility fix

This commit is contained in:
João Antônio Duarte 2020-08-28 18:21:27 -03:00
parent a258bae533
commit 8e0187a408
2 changed files with 13 additions and 4 deletions

View File

@ -64,8 +64,10 @@ type
function ProxyPassword(const aProxyPassword: string): IMVCRESTClient; overload; function ProxyPassword(const aProxyPassword: string): IMVCRESTClient; overload;
function ProxyPassword: string; overload; function ProxyPassword: string; overload;
{$IF defined(TOKYOORBETTER)}
function SecureProtocols(const aSecureProtocols: THTTPSecureProtocols): IMVCRESTClient; overload; function SecureProtocols(const aSecureProtocols: THTTPSecureProtocols): IMVCRESTClient; overload;
function SecureProtocols: THTTPSecureProtocols; overload; function SecureProtocols: THTTPSecureProtocols; overload;
{$ENDIF}
function UserAgent(const aUserAgent: string): IMVCRESTClient; overload; function UserAgent(const aUserAgent: string): IMVCRESTClient; overload;
function UserAgent: string; overload; function UserAgent: string; overload;

View File

@ -62,8 +62,10 @@ type
/// </summary> /// </summary>
TCookie = System.Net.HttpClient.TCookie; TCookie = System.Net.HttpClient.TCookie;
TCookies = System.Net.HttpClient.TCookies; TCookies = System.Net.HttpClient.TCookies;
{$IF defined(TOKYOORBETTER)}
THTTPSecureProtocol = System.Net.HttpClient.THTTPSecureProtocol; THTTPSecureProtocol = System.Net.HttpClient.THTTPSecureProtocol;
THTTPSecureProtocols = System.Net.HttpClient.THTTPSecureProtocols; THTTPSecureProtocols = System.Net.HttpClient.THTTPSecureProtocols;
{$ENDIF}
/// <summary> /// <summary>
/// Encapsulates the methods of the delphi native RESTClient library. /// Encapsulates the methods of the delphi native RESTClient library.
@ -116,8 +118,10 @@ type
function ProxyPassword(const aProxyPassword: string): IMVCRESTClient; overload; function ProxyPassword(const aProxyPassword: string): IMVCRESTClient; overload;
function ProxyPassword: string; overload; function ProxyPassword: string; overload;
{$IF defined(TOKYOORBETTER)}
function SecureProtocols(const aSecureProtocols: THTTPSecureProtocols): IMVCRESTClient; overload; function SecureProtocols(const aSecureProtocols: THTTPSecureProtocols): IMVCRESTClient; overload;
function SecureProtocols: THTTPSecureProtocols; overload; function SecureProtocols: THTTPSecureProtocols; overload;
{$ENDIF}
function UserAgent(const aUserAgent: string): IMVCRESTClient; overload; function UserAgent(const aUserAgent: string): IMVCRESTClient; overload;
function UserAgent: string; overload; function UserAgent: string; overload;
@ -283,10 +287,8 @@ type
/// <param name="aContentType"> /// <param name="aContentType">
/// File content type /// File content type
/// </param> /// </param>
function AddFile(const aName, aFileName: string; function AddFile(const aName, aFileName: string; const aContentType: string = ''): IMVCRESTClient; overload;
const aContentType: string = ''): IMVCRESTClient; overload; function AddFile(const aFileName: string; const aContentType: string = ''): IMVCRESTClient; overload;
function AddFile(const aFileName: string;
const aContentType: string = ''): IMVCRESTClient; overload;
function ClearFiles: IMVCRESTClient; function ClearFiles: IMVCRESTClient;
/// <summary> /// <summary>
@ -780,6 +782,9 @@ begin
.ProxyPassword(ProxyPassword) .ProxyPassword(ProxyPassword)
.ProxyServer(ProxyServer) .ProxyServer(ProxyServer)
.UserAgent(UserAgent) .UserAgent(UserAgent)
{$IF defined(TOKYOORBETTER)}
.SecureProtocols(SecureProtocols)
{$ENDIF}
.ConnectTimeout(ConnectTimeout) .ConnectTimeout(ConnectTimeout)
.ReadTimeout(ReadTimeout) .ReadTimeout(ReadTimeout)
.Accept(Accept) .Accept(Accept)
@ -1261,6 +1266,7 @@ begin
Result := fRESTRequest.URLAlreadyEncoded; Result := fRESTRequest.URLAlreadyEncoded;
end; end;
{$IF defined(TOKYOORBETTER)}
function TMVCRESTClient.SecureProtocols: THTTPSecureProtocols; function TMVCRESTClient.SecureProtocols: THTTPSecureProtocols;
begin begin
Result := fRESTClient.SecureProtocols; Result := fRESTClient.SecureProtocols;
@ -1271,6 +1277,7 @@ begin
Result := Self; Result := Self;
fRESTClient.SecureProtocols := aSecureProtocols; fRESTClient.SecureProtocols := aSecureProtocols;
end; end;
{$ENDIF}
function TMVCRESTClient.SerializeObject(aObject: TObject): string; function TMVCRESTClient.SerializeObject(aObject: TObject): string;
begin begin