mirror of
https://gitlab.com/freepascal.org/fpc/pas2js.git
synced 2025-08-18 03:59:04 +02:00
* Memo field has no max length, encode param values with EncodeUriComponent
This commit is contained in:
parent
3f2fac179e
commit
9c9231e6ba
@ -87,6 +87,7 @@ Type
|
|||||||
function GetP(aIndex : Integer): TQueryParam;
|
function GetP(aIndex : Integer): TQueryParam;
|
||||||
procedure SetP(aIndex : Integer; AValue: TQueryParam);
|
procedure SetP(aIndex : Integer; AValue: TQueryParam);
|
||||||
Public
|
Public
|
||||||
|
function AddParam(aName : string; aEnabled : Boolean = False) : TQueryParam; overload;
|
||||||
Property Params[aIndex : Integer] : TQueryParam Read GetP Write SetP; default;
|
Property Params[aIndex : Integer] : TQueryParam Read GetP Write SetP; default;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -193,7 +194,6 @@ end;
|
|||||||
function TQueryParam.AsQuery: String;
|
function TQueryParam.AsQuery: String;
|
||||||
|
|
||||||
var
|
var
|
||||||
S : String;
|
|
||||||
B : TBytes;
|
B : TBytes;
|
||||||
I : Integer;
|
I : Integer;
|
||||||
|
|
||||||
@ -221,7 +221,7 @@ begin
|
|||||||
else
|
else
|
||||||
Result:=AsString
|
Result:=AsString
|
||||||
end;
|
end;
|
||||||
Result:=Name+'='+encodeURIComponent(AsString);
|
Result:=Name+'='+Result;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TQueryParams }
|
{ TQueryParams }
|
||||||
@ -236,6 +236,13 @@ begin
|
|||||||
Items[aIndex]:=aValue;
|
Items[aIndex]:=aValue;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TQueryParams.AddParam(aName: string; aEnabled: Boolean): TQueryParam;
|
||||||
|
begin
|
||||||
|
Result:=add As TQueryParam;
|
||||||
|
Result.Name:=aName;
|
||||||
|
Result.Enabled:=aEnabled;
|
||||||
|
end;
|
||||||
|
|
||||||
{ TServiceRequest }
|
{ TServiceRequest }
|
||||||
|
|
||||||
constructor TServiceRequest.Create(const aMethod,aURL, aUserName, aPassword: String; aOnDone1 : TNotifyEvent; aOnDone2 : TNotifyEvent = Nil);
|
constructor TServiceRequest.Create(const aMethod,aURL, aUserName, aPassword: String; aOnDone1 : TNotifyEvent; aOnDone2 : TNotifyEvent = Nil);
|
||||||
@ -582,8 +589,10 @@ begin
|
|||||||
if Not jsIsNan(toNumber(D)) then
|
if Not jsIsNan(toNumber(D)) then
|
||||||
begin
|
begin
|
||||||
Result:=Trunc(toNumber(D));
|
Result:=Trunc(toNumber(D));
|
||||||
if (Result<=0) then
|
if (Result<0) then
|
||||||
Raise EJSONDataset.CreateFmt('Invalid maximum length specifier for field %s',[AName])
|
Raise EJSONDataset.CreateFmt('Invalid maximum length specifier for field %s',[AName])
|
||||||
|
else if Result=0 then // memofield
|
||||||
|
Result:=1000000
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
|
Loading…
Reference in New Issue
Block a user