I wanted to send JSON data to another app with using HTTP Request / POST in UiPath. But I could not do. Error message is 401-UnAuthorized at the app-side (destination)
This is the python code that i used for this purpose (sending JSON data) before…
payload = {“auth_token”: “YOUR_AUTH_TOKEN”, “status”:stu2, “data-title1”:indeks, “data-title2”:env, “data-title3”:pakno, “data-title4”:cur, “data-title5”:tmp}
r=requests.post(“http://xxxxxx:3030/widgets/hot21”,data=json.dumps(payload))
I tried to write Robot-equivalent as follows jason.csv File:
status,data-title1,data-title2,data-title3,data-title4,data-title5
green,21,emre,pakno,cur,tmp Read CSV:
FilePath: “json.csv”
DataTable: dtCSV Assign:
payload=jsonConvert.SerializeObject(dtCSV)
(payload is string) HTTP Request:
EndPoint: “http://xxxxxx:3030/widgets/hot21”
Method: POST
OAuth2/OAuth2Token:“YOUR_AUTH_TOKEN”
Body: payload