Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When the value of a non-required parameter is empty, our wsclient http request bodies currently displays the null/empty element in json as:
{not-required-empty-parameter: "null"};
And in XML as:
<not-required-empty-parameter />
We are looking for an option to remove these elements from the request body when the value of the parameter is not defined in rules. The web-services we are integrating does not accept empty elements and is returning errors. It requires that if the element is empty, exclude it from the request body.
Comments
Comment #1
freddura CreditAttribution: freddura commentedI've been able to hard code this functionality after applying the patch provided by Comment #17 on Issue #1280332...
This is a code snippet from wsclient/wsclient_rest/wsclient_rest.inc lines 61-95 after applying the patch:
And this is a code snippet from wsclient/wsclient_rest/wsclient_rest.inc lines 61-110 after adding my code, bringing in this new functionality:
This can still use work for the purpose making it an option in the UI as some situations may not require this behavior.