Skip to content

Commit

Permalink
Created overload constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
viniciussanchez committed Aug 21, 2019
1 parent f520796 commit 8fc0d2b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/core/RESTRequest4D.Request.pas
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ TRequest = class(TInterfacedObject, IRequest)
function ExecuteAsync(ACompletionHandler: TProc = nil; ASynchronized: Boolean = True; AFreeThread: Boolean = True;
ACompletionHandlerWithError: TProc<TObject> = nil): TRESTExecutionThread;
public
constructor Create(const AMethod: TRESTRequestMethod = rmGET; const ABaseURL: string = ''; const AToken: string = '');
constructor Create(const ABaseURL: string; const AToken: string = ''); overload;
constructor Create(const AMethod: TRESTRequestMethod = rmGET; const ABaseURL: string = ''; const AToken: string = ''); overload;
destructor Destroy; override;
end;

Expand Down Expand Up @@ -98,6 +99,11 @@ function TRequest.Body: IRequestBody;
Result := FBody;
end;

constructor TRequest.Create(const ABaseURL, AToken: string);
begin
Create(rmGET, ABaseURL, AToken);
end;

constructor TRequest.Create(const AMethod: TRESTRequestMethod = rmGET; const ABaseURL: string = ''; const AToken: string = '');
begin
FRESTResponse := TRESTResponse.Create(nil);
Expand Down

0 comments on commit 8fc0d2b

Please sign in to comment.