Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Modify form-data Request body - Add new Key-Value

We have an use case where were receive form-data payload with multiple key value pairs. I need extract value from one key, create an json object and assign it to new Key. 
New payload should have the existing values along with the new one.

Example:

adithyaseelam_0-1687747975482.png

 

adithyaseelam_2-1687747679195.png

 

 

From the above screen shot. I need to extract value of Sample Key which is an json object and create a new Key Sample2 in the below json format. 

 

{                
"Trace-Id": "abc123ABC",
"Time": "{client.received.end.timestamp}",
"Payload": ["{Sample Value}"]
}  

 

My Final req going to target system should look like below snapshot.

adithyaseelam_3-1687747742399.png

 

 

Solved Solved
1 7 2,458
1 ACCEPTED SOLUTION

If I were you I would set the debug property to true, and then examine the trace, to see the call stack when the exception is thrown. javax.json.JsonValue is a class that is used inside the callout, for parsing JSON.  I don't know why it would be giving that error. Your configuration works for me. 

Do you have the two required dependency jars in your proxy bundle? 

  • javax.json-api-1.1.4.jar
  • javax.json-1.1.4.jar

 

View solution in original post

7 REPLIES 7