You are not logged in.
Pages: 1
Hello,
in the example "14 - Interface based services" I added a function "Add1":
function Add1(const Data: TRecTest): integer;
Die Parameter N1 und N2 habe ich in einem Record definiert:
type
TRecTest = packed record
n1: integer;
n2 : integer;
end;
I now want to receive the JSON string sent by the client via the parameter of the funtion.
From Client comes:
http://localhost:8888/root/Calculator.add1/?n1=1&n2=2
In function "Add1":
...
result := Data.n1 + Data.n2;
...
I tried everything but the record "Data" is always "empty". What am I doing wrong?
I would be very, very grateful if someone could help me.
Thank you very much
Olaf
PS:
Please excuse my bad english!
Offline
You can try this:
http://localhost:8888/root/Calculator.add1/?Data={n1:1,n2:2}
Offline
Hello Chaa,
thank you very much! This has already helped me once before.
However, I still have a problem with understanding. I use the "Postman" program to make test calls. If I refer to the API "Add1" and transfer the parameters from "Data={N1:5, N2:13}" as form-data, they will not be forwarded within the server.
Only if I transfer them as "RAW" format, they can be read within the function.
In plain language:
URL
http://localhost:8888/root/Calculator.add1
...
Form-Data
Data: {N1:5, N2:13}
In the server in the function "Add1" the parameter "Data" is empty.
...
RAW
{Data: {"n1": 10,"n2": 2}}}
In the server in the function "Add1" the parameter "Data" is filled.
Since I'm moving quite new in the REST server world, it's a little hard for me to do that. Unfortunately, my search via Google has not been successful so far.
Thank you in advance for any help!!!!
regards
Olaf
Offline
Hello, Ab,
Thank you very much now I have understood it! : -)
Offline
Pages: 1