POST method with query parameters with Centrasite

520 views Asked by At

I want to use Mediator 9.7, configured by CentraSite 9.7, to virtualize a REST API.

For a resource, with POST Method, I want to pass a json content and some query parameters. But with or without configuring parameters in the resource or in the method in centrasite, query parameters are never sent to the native endpoint.

In GET method, query parameters are always sent without problems.

When I post this request to Mediator :

POST http://virtual-wm/v2.0/resource/test?from_date=2017-08-01&to_date=2017-08-31 HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: application/json
Authorization: truc
Content-Length: 14
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)

["data"] 

The native endpoint receive this :

POST https://api.services/v2.0/resource/test HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: application/json
Authorization: truc
Content-Length: 14
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)

["data"] 

Of course this is not i want. I would like that query parameters sent to the native point even with POST method.

How can I achieve this ?

1

There are 1 answers

0
volia17 On BEST ANSWER

Finally, i found this on software AG support (it was not so simple to find it)

CentraSite - Mediator not handling query string parameters in POST
Product:    CentraSite (INM)    
Version:    9.9      
Last Updated:   31-MAR-2017      
________________________________________
Description:  
When invoking a REST virtual service through the Mediator, POST requests are     sent to the backend but without their query string parameters.
________________________________________
Resolution:  
Query parameters for POST method are not supported until version 9.12.

So, no solution for this problem, except an upgrade to 9.12