Hello,
I had the following Json code:
{
"name": "Créer dossier name",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"Status code is 201\", function () {\r",
" pm.response.to.have.status(201);\r",
"});\r",
"\r",
"pm.test(\"Response numen\", function () {\r",
" var jsonDataResponse = pm.response.json()\r",
" var jsonDataRequest = JSON.parse(pm.request.body.raw)\r",
" \r",
" pm.expect(jsonDataResponse.numenDossierAgent).is.not.null;\r",
" pm.expect(jsonDataResponse.numenDossierAgent).is.equal(jsonDataRequest.numenDossierAgent)\r",
"});\r",
"\r",
"pm.test(\"Response uid\", function () {\r",
" var jsonDataResponse = pm.response.json()\r",
" pm.expect(jsonDataResponse.uid).is.not.null;\r",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\r\n \"numen\": \"00A0009140MCA\"\r\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "http://xxxxx/ged/agents",
"protocol": "http",
"host": [
"host",
"omogen",
"in",
"cloe",
"education",
"gouv",
"fr"
],
"path": [
"ged-ruda",
"agents"
]
}
},
"response": []
},
and i would to pass it as a body of a Http request.
Thre is a king of formatting used in post:
https://forum.uipath.com/t/http-post-request-error/32881/27?u=abdel
but tyed with the file attached always error
creation dossier agent.txt (915 Bytes)
Jsonbody.txt (817 Bytes)
my last test gives
{
"message": "Create_response ={\"entity-type\":\"exception\",\"status\":500,\"message\":\"Internal Server Error\"}",
"level": "Trace",
"logType": "User",
"timeStamp": "17:40:06",
"processVersion": "1.0.0",
"jobId": "8c628566-cb7a-443a-ae39-972039dae20d",
"robotName": "abffffff@gmail.com-attended",
"machineId": 1877763,
"organizationUnitId": 3515672
}