Support Article
REST request malformed when query string param is blank
SA-76949
Summary
When the Connect-REST rule (JSON) has only a Single query string parameter and if the value of the parameter is blank, then the REST Request is malformed. This works if a dummy query string parameter is added to the Connect-REST rule.
For example:
The query string for the request is as follows:
Single parameter:
Expected:
http://xxxxdev/prweb/PRRestService/DocCatalogSvcs/SearchDocuments/Search?docNameOrNumber=
Actual:
http://xxxxdev/prweb/PRRestService/DocCatalogSvcs/SearchDocuments/Search?docNameOrNumber
Two parameters:
Expected:
http://xxxxdev/prweb/PRRestService/DocCatalogSvcs/SearchDocuments/Search?docNameOrNumber=&docType=
Actual:
http://xxxxdev/prweb/PRRestService/DocCatalogSvcs/SearchDocuments/Search?docNameOrNumber=&docType=
Error Messages
HTTP Status: 400 Bad Request
Message: The request could not be understood by the server due to malformed syntax
Steps to Reproduce
- Use a REST Service that accepts only a Single query string parameter.
- Invoke the Connect-REST rule without passing a value for the query string parameter. This results in an error due to a malformed request.
Resource path generated: http://xxxxdev/prweb/PRRestService/DocCatalogSvcs/SearchDocuments/Search?docNameOrNumber
Root Cause
A defect in Pegasystems’ code or rules.
Resolution
Perform the following local-change:
Set the pySkipBlankQueryParts parameter in the Request data transform.
Published May 12, 2019 - Updated October 8, 2020
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.