Skip to main content

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
------------------------------

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
------------------------------

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
------------------------------

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
------------------------------

Hi Nicolas,

Why are you using a DSP to create REST API ?  Use an USP.

We have no problem with USP whatever the http word used.

Gilles.

 



------------------------------
Hortion Gilles
Dedalus Healthcare France
Artigues Pres Bordeaux FR
------------------------------

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
------------------------------

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
------------------------------

Hi Nicolas,

Why are you using a DSP to create REST API ?  Use an USP.

We have no problem with USP whatever the http word used.

Gilles.

 



------------------------------
Hortion Gilles
Dedalus Healthcare France
Artigues Pres Bordeaux FR
------------------------------

Hi Gilles

Thanks for your advice
I'll try asap

Regards



------------------------------
Nicolas Colmart
Self Registered
Nice FR
------------------------------