json corelation

Hi Stephane,
I have captured json response and had perform a replace function on that response.
I need to convert that response to json again so that i can use json path extractor for my corelation.

PLease help me with the code
Here is my code:

.exec(http(“request_24”)
.post("/isf/store/mashupController.do")
.headers(headers_24)
.formParam(“scControllerData”, “”"{“MashupRefs”:{“MashupRef”:[{“mashupId”:“extn.isf.shipment-pick.pick-order-list.getSFSPickOrderList”,“Input”:{“Shipment”:{“ComplexQuery”:{“And”:{“Or”:[{“Exp”:[{“Name”:“Status”,“QryType”:“EQ”,“Value”:“1100.70.06.10”}]},{“Exp”:[{“Name”:“DocumentType”,“QryType”:“FLIKE”,“Value”:“0001”},{“Name”:“DocumentType”,“QryType”:“FLIKE”,“Value”:“0006”}]}]}},“DeliveryMethod”:“PICK”,“OrderBy”:{“Attribute”:{“Desc”:“N”}}}},“isPaginated”:“true”,“scPageSize”:“10”,“scPageNumber”:“1”,“scPaginationStrategy”:“NEXTPAGE”}],“isMultiAPICall”:false}}""")
.formParam(“scCSRFToken”, “${scCSRFToken}”)
.formParam(“scFlag”, “Y”)
.check(bodyString.saveAs(“Auth_Response”)))

.exec(session => {
// put body response into variable
val res = session(“Auth_Response”).toString
// use replace method to modify your json (which is right now a string)
val newResponse = res.replace("\x", “”)

session.set(“Auth_Response”, newResponse)
//.check(jsonPath("$.controllerData.MashupRefs.MashupRef[0].Output.Page.Output.Shipments.Shipment[0].ShipmentKey").find.saveAs(“ShipmentKey”))

}
)

Try to use responseTransform instead to patch the response body: https://gatling.io/docs/gatling/reference/current/http/request/#response-transformers

Or better, as I suggested, report this issue to the API developers so they fix it upstream, as this payload is clearly not valid JSON.