Consuming a GET API with Request body

Dear Community,

We have a technical challenge with a Connect REST API where an external system exposes a GET endpoint that expects a request body.

Ideally, in Pega, GET methods DO NOT allow us to map a request body in the Connect REST rule.

I wouldn’t necessarily consider this is a technical limitation of Pega as it is follows Standard HTTP practices as defined here GET request method - HTTP | MDN

However, Postman allows us to send a request body with a GET request, and the same can also be achieved using curl command.

We could ask the service provider to change the contract but it seems that this endpoint is being used by other systems and they cannot simply change the existing endpoint from GET to POST without potentially impacting other consumers.

Have you faced similar challenge before ? or any suggestions or recommendations on how to best approach this ?

Looked at some of the OOTB rules to tweak and found out that the activity pyInvokeRESTConnector has a method “tools.invokeConnector( primaryPage, stepPage, params );” which invokes the connector and it is somehow a blackbox.

I would like to know from the Product team to know better why it is a limitation when the RFC dont have such limitation.

But for you @YaswanthD, i don’t think this will be solved immediately from product side. I would suggest 2 options.

  1. Request the provider to create a additional POST Method so that existing consumers are not impacted.
  2. If option 1 is not possible, another alternative is to have a ESB / API gateway layer to do the transformation.

Thanks.

I agree with @ArulDevan recommendations. HTTP GET method only supports headers and query string parameters. There is no OOTB support for mapping a request body for GET operations.

Thanks @ArulDevan @RameshSangili for your responses. We managed to push the service provider to create a new POST endpoint and they agreed to do so.

Hi @YaswanthD : Glad to know that the issue is resolved. It would be good if you can close this thread so that the community can focus on the open problems :slight_smile:

Thanks.