Question
infosys
IN
Last activity: 22 Sep 2022 6:54 EDT
Formatting the json string for multipart/form using pyRequestAttachment page
We are passing key-value pairs in the format of multipart/form-data as request to a service using connect-rest in post method as body. Using pyRequestAttachment page belonging to Data-ServiceMessage class we are setting the file and metadata as string. So before setting the value we are converting the Request to json String.Hence the value is in below format:
metadata = {"person_Id":"123", "person_name":"xyz", "is_Secure":"false"}
Due to changes in service, it is expecting boolean values for few properties liek below:
metadata = {"person_Id":"123", "person_name":"xyz", "is_Secure":false}
It would be helpful if anyone can guide how to re-format the String as above before invoking Connect-Rest.