Hi Jean Marc
Thanks for your answer
Our API must return json data from a GET request.
The request must have some parameters in order to filter the data returned.
We thought it could be possible to receive the input parameters in Json format.
But as I can see, the only way to have input parameters for a GET request is from the URL itself.
Regards,
------------------------------
Nicolas Colmart
Self Registered
Nice FR
------------------------------
Original Message:
Sent: 01-26-2024 10:12
From: Jean-Marc SALIS
Subject: Uniface API (DSP) does not receive Json parameters when called with GET
I'm not sure I understand. Do you want to get json data, or to send it to your API ?
With a GET command, you can pass parameters in your URL (something like https://www.yourapi.com/api/v1/user/12 or https://www.yourapi.com/api/v1/user?id=12 ) and then recieve json (or any format you need).
But if you want to send a payload in json, you should use POST (or PUT). POST is (supposed to be) used for creation and PUT for updates.
More infos on https://restfulapi.net/http-methods/
------------------------------
Jean-Marc SALIS
Mp Services
Montauban Cedex FR
Original Message:
Sent: 01-26-2024 09:08
From: Nicolas Colmart
Subject: Uniface API (DSP) does not receive Json parameters when called with GET
Hi
We are writing our first REST Api with Uniface 9.7.04.
In the DSP, we extract the input parameters with $webinfo("input").
When calling our API with a test tool (postman, SoapUI, etc) with PUT with Json data, the input parameters are received.
But when calling the same API with the same tool and the same parameters but with GET, the input parameters are always empty.
Is it normal to not receive the json input data when called with GET?
How can we get them ?
Thanks,
Regards
------------------------------
Nicolas Colmart
Self Registered
Nice FR
------------------------------