Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
viniciussanchez committed Nov 14, 2023
1 parent f3085d6 commit 5b0ede8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/RESTRequest4D.Request.Client.pas
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ TRequestClient = class(TInterfacedObject, IRequest)
function Delete: IResponse;
function Patch: IResponse;
function ClearBody: IRequest;
function AddParam(const AName, AValue: string; const AKind: TRESTRequestParameterKind = {$IF COMPILERVERSION < 33}TRESTRequestParameterKind.pkGETorPOST{$ELSE}TRESTRequestParameterKind.pkQUERY{$ENDIF}): IRequest;
function AddParam(const AName, AValue: string; const AKind: TRESTRequestParameterKind = {$IF COMPILERVERSION < 33}TRESTRequestParameterKind.pkGETorPOST{$ELSE}TRESTRequestParameterKind.pkQUERY{$ENDIF}; const AOptions: TRESTRequestParameterOptions = []): IRequest;
function AddBody(const AContent: string; const AContentType: TRESTContentType = ctAPPLICATION_JSON): IRequest; overload;
function AddBody(const AContent: TJSONObject; const AOwns: Boolean = True): IRequest; overload;
function AddBody(const AContent: TJSONArray; const AOwns: Boolean = True): IRequest; overload;
Expand Down Expand Up @@ -214,13 +214,13 @@ function TRequestClient.AddHeader(const AName, AValue: string; const AOptions: T
FRESTRequest.Params.ParameterByName(AName).Options := AOptions;
end;

function TRequestClient.AddParam(const AName, AValue: string; const AKind: TRESTRequestParameterKind): IRequest;
function TRequestClient.AddParam(const AName, AValue: string; const AKind: TRESTRequestParameterKind = {$IF COMPILERVERSION < 33}TRESTRequestParameterKind.pkGETorPOST{$ELSE}TRESTRequestParameterKind.pkQUERY{$ENDIF}; const AOptions: TRESTRequestParameterOptions = []): IRequest;
begin
Result := Self;
if AName.Trim.IsEmpty or AValue.Trim.IsEmpty then
Exit;
FParams.Add(AName);
FRESTRequest.AddParameter(AName, AValue, AKind);
FRESTRequest.AddParameter(AName, AValue, AKind, AOptions);
end;

function TRequestClient.AddUrlSegment(const AName, AValue: string): IRequest;
Expand Down
2 changes: 1 addition & 1 deletion src/RESTRequest4D.Request.Contract.pas
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ interface
{$ELSE}
function SynchronizedEvents(const AValue: Boolean): IRequest;
function AddHeader(const AName, AValue: string; const AOptions: TRESTRequestParameterOptions = []): IRequest;
function AddParam(const AName, AValue: string; const AKind: TRESTRequestParameterKind = {$IF COMPILERVERSION < 33}TRESTRequestParameterKind.pkGETorPOST{$ELSE}TRESTRequestParameterKind.pkQUERY{$ENDIF}): IRequest;
function AddParam(const AName, AValue: string; const AKind: TRESTRequestParameterKind = {$IF COMPILERVERSION < 33}TRESTRequestParameterKind.pkGETorPOST{$ELSE}TRESTRequestParameterKind.pkQUERY{$ENDIF}; const AOptions: TRESTRequestParameterOptions = []): IRequest;
function AddBody(const AContent: string; const AContentType: TRESTContentType = ctAPPLICATION_JSON): IRequest; overload;
function FallbackCharsetEncoding(const AFallbackCharsetEncoding: string): IRequest;
{$ENDIF}
Expand Down

0 comments on commit 5b0ede8

Please sign in to comment.