Hi Folks,
I’m trying to add the roles to specific user with help of “Roles.txt”, this will connect to the internal UNIX server and run will get the result about roles assigned or already assigned. I don’t have any issue with header passing in http request.
Kindly help how to pass --data-binary “@roles.txt” in HTTP request along with header in UiPath Studio
Command I would like to use for this activity in http request:
curl -X POST https://XXXXXXXXXXXX -k --header “environment: ” --data-binary “@roles.txt”
Also check the Endpoint docu (please share with us if possible). Maybe the roles.txt is to pass by the body along with a content type / format definition
Thank you.
I tried passing the file after attachment section and passing that in Body not worked. I tried using read and write text file by assigning it into body , tried adding it under parameters section. No luck. Any other options, can I try here by giving the file to read from UiPath to pass --data binary in http request. or anything I need to do it in BODY section to pass from UiPath studio. Please advice.
Yes. I did the same way.
Below is the API reference and we included this logic by customised in our script already. Now we just need to pass the file content to trigger, It might be helpful for you, please have a look once.
First one is customised API curl URL which we are using rather than the second shared one (this is the main reference API which we referred)
Below is the customised curl syntax to run it directly from our server.
curl -X POST https://<server_name>/refresh/configure_user_roles -k --header "environment: " --data-binary "@roles.txt""
Thank you for the advice.
I tried placing the file content as base64 String in the body, but not taking as expected. Is anywhere i need to pass base64 String value to be picked ?
I tried to change the content-types like: application/octet-string; multipart/form-data; application/json; application/xml, but no luck.
In Post man , under body section , suggested to use binary format to select the desired file to send the request, this i need to recheck one more time.
However , I understood that, it has to pass it through base64 String in the body in HTTP request(Note : I tried directly passing file content in body, not working), but something I’m missing here to do, please advice.