Asynchttp_v1 Body parameter should be a string or if json a Map or List to auto convert

I would like to send a payload that look like this:
{ index: {} }

where { index: {} } could be any json object, but the key here is that I need a \n at the end of the payload so I CAN’T use the map as part of the body and if i try this:

def json = new groovy.json.JsonBuilder(
index: “”
}
def params = [

uri: "https://blah.com",

path: "/iot_analytics-test-2020/_bulk",

contentType: "application/x-ndjson",

requestContentType: "application/x-ndjso",

headers: ['Authorization': "Basic " + basicAuth],

body: "${json.toString()}\n"

]
asynchttp_v1.post(processLogEventsResponse, params)

com.amazonaws.services.cloudfront.model.InvalidArgumentException: Body parameter should be a string or if json a Map or List to auto convert (Service: null; Status Code: 0; Error Code: null; Request ID: null) @line 506 (postEventsToHttpEndpoint)

As far as I know, body should be a string at this point, I don’t get it…