What is the correct way to request /intake/v2/rum/events?

from locust import HttpLocust, TaskSet, task, HttpUser, run_single_user

class QuickstartUser(HttpUser):
    host = "https://apmserver"

    @task()
    def user_sign(self):
        payload = "{\"metadata\": {\"service\": {\"name\": \"pa-os\",\"version\": \"0.0.1\",\"agent\": {\"name\": \"rum-js\",\"version\": \"5.1.1\"},\"language\": {\"name\": \"javascript\"}}} } {\"transaction\": {\"id\": \"4bfa932d89b48c4c\",\"trace_id\": \"a5273ad0008b9d0e39c373c777c6a3cc\",\"name\": \"pa-oswebsiteadmin/homePicture/getPictures\",\"type\": \"custom\",\"duration\": 298.7999999523163,\"context\": {\"page\": {\"referer\": \"https://pa-dev.XXX.com/officialSite\",\"url\": \"https://dev.XXX.com/officialSite\"},\"custom\": {\"name\": \"\",\"userName\": \"\",\"pageName\": \"XXXXX\",\"method\": \"get\",\"api\": \"getPictures\",\"responseStatus\": 200}},\"span_count\": {\"started\": 1},\"sampled\": true} } {\"span\": {\"id\": \"285b37e5a361c1d0\",\"transaction_id\": \"4bfa932d89b48c4c\",\"parent_id\": \"4bfa932d89b48c4c\",\"trace_id\": \"a5273ad0008b9d0e39c373c777c6a3cc\",\"name\": \"get/websiteadmin/homePicture/getPictures\",\"type\": \"external\",\"start\": 0.09999990463256836,\"duration\": 298.7000000476837}"
        headers = {"Content-Type": "application/x-ndjson"}
        with self.client.post("/intake/v2/rum/events",headers=headers , data=payload.encode('utf-8'), catch_response=True) as resp:
            pass

if __name__ == "__main__":
    run_single_user(QuickstartUser)

I'm getting wrong results and I don't know how to do it right, can anyone give me some advice?

I found similar bugs, but this bug seems to have been fixed 1514

'{ "accepted": 0, "errors": [   {     "message": "EOF while reading metadata",     "document": "{"metadata": {"service": {"name": "pa-os","version": "0.0.1","agent": {"name": "rum-js","version": "5.1.1"},"language": {"name": "javascript"}}} } {"transaction": {"id": "4bfa932d89b48c4c","trace_id": "a5273ad0008b9d0e39c373c777c6a3cc","name": "pa-oswebsiteadmin/homePicture/getPictures","type": "custom","duration": 298.7999999523163,"context": {"page": {"referer": "https://dev.XXX.com/officialSite","url": "https://dev.XXX.com/officialSite"},"custom": {"name": "","userName": "","pageName": "\xe5\xae\x98\xe7\xbd\x91\xe9\xa6\x96\xe9\xa1\xb5\xe7\xae\xa1\xe7\x90\x86","method": "get","api": "getPictures","responseStatus": 200}},"span_count": {"started": 1},"sampled": true} } {"span": {"id": "285b37e5a361c1d0","transaction_id": "4bfa932d89b48c4c","parent_id": "4bfa932d89b48c4c","trace_id": "a5273ad0008b9d0e39c373c777c6a3cc","name": "get/websiteadmin/homePicture/getPictures","type": "external","start": 0.09999990463256836,"duration": 298.7000000476837}"   } ]}'