You are not logged in.
I have a simple server derived from TSQLHttpServer that overrides function Request(Ctxt: TServerRequest)
in this function I extract params passed in the Ctxt.url using my own code (did not find it in SynCommons...) that returns them as a TDocVariantData
and I extract other params with InitJSON(Ctxt.InContent) which also returns a TDocVariantData
How can I merge both to have all my params regardless on how they are passed ?
Or did I miss the function that does both ?
Thanks !
Offline
Thanks but AddFrom doesn't work (Delphi XE5) I get E2010 Incompatible types: 'Variant' and 'TDocVariantData'
I wrote this, but still have problem with some complexe requests :
function MergeParams(
inplace: TDocVariantData;
const toadd: TDocVariantData): TDocVariantData;
var
i: integer;
n: string;
v: variant;
begin
// inplace.AddFrom(toadd); // E2010 Incompatible types: 'Variant' and 'TDocVariantData'
for i := 0 to toadd.Count - 1 do begin
n := toadd.Names[i];
if n <> '' then
inplace.AddValue(n, toadd[i])
end;
result := inplace;
end;
Offline