kyqurikan
(Brian Bennett)
May 15, 2019, 2:17pm
1
Hello,
I have checked here: How to send a Body type "Form Data" using POST in a HTTP Request
and here: How to pass JSON in HTTP POST request body? - #2 by loginerror
I’m trying to upload a file. I can do it in postman:
It fails in uipath:
Any help appreciated.
HareeshMR
(Hareesh Madasi)
May 15, 2019, 2:26pm
2
Hi @kyqurikan ,
Declare the variable as the type JsonObject and pass it with double quotes, then it will work
Refer this posts:
Hi @gopianth ,
The problem is that, the string needs to be in a single line while you are assigning it to a variable, it can’t be as the body we send in postman.
Here is the workflow PassingJsonStringFromAssign.zip (1.9 KB)
Let me know if it helps
This one is working… I don’t know why it is working with double quotes only…
“{”“name”“:”“” + emp_name+ “”“,”“salary”“:”“” + emp_salary+ “”“,”“age”“:”“” + emp_Age+ “”“}”
Sorry for all the confusion…
Replace myJson activity value with the above and it is working…
The change is → replace all the single quotes with two double quotes
i.e., ’ → “”
1 Like
@kyqurikan ,
Can you please check this link. This might helpful for you question.
@skajulio ,
Can you give sample URL with form-data input so that I can create process and update to you.
Thanks,
Arunachalam.
Please let me know if you’re facing same problem.
Thanks,
Arunachalam.
kyqurikan
(Brian Bennett)
May 15, 2019, 2:34pm
4
The parameter just has string. How do you change it. Double clicking on Type does nothing and I don’t see a way to change it.
HareeshMR
(Hareesh Madasi)
May 15, 2019, 2:37pm
5
I think you have to pass the body as string and no need to change the type… Just pass the value for the variable as
“{”“Key1”“:”“Value1””,““Key2””:““Value2””,”“Key3”“:”“Value3””}"
It will work for sure
If you want to change variable types,
In the variables pane below the workflow, you can change the type by double clicking on the type. You will get a drop down and browse for more types.
kyqurikan
(Brian Bennett)
May 15, 2019, 2:46pm
6
I read through the link, I don’t see how it helps solve the issue. I don’t see any examples on any of these posts on how to accomplish this task. I don’t mean to sound snappy. I appreciate the response.
kyqurikan
(Brian Bennett)
May 15, 2019, 2:49pm
7
I don’t think I can do that because I’m trying to upload a file to Oracle Content and Experience Cloud using the API. The documentation requires the file be uploaded using form-data. They don’t have examples of how to accomplish this passing the body as a string.
1 Like
HareeshMR
(Hareesh Madasi)
May 15, 2019, 4:06pm
8
@kyqurikan ,
I just saw the file you have attached as a form data,
but we have the option as in the screenshot
Can you try this one?
kyqurikan
(Brian Bennett)
May 15, 2019, 4:57pm
9
After further tampering I believe the issue is with the
jsonInputParameter value:
“{“parentID”: “FEF98F4245FABCCFB2DA03FDFC254717B94CC7FC3C29”}”
UiPath doesn’t like it.
HareeshMR
(Hareesh Madasi)
May 15, 2019, 4:59pm
10
Just replace single quote with double quote… nothing to confuse
i.e., " → “”
“{”“parentID”": ““FEF98F4245FABCCFB2DA03FDFC254717B94CC7FC3C29"”}”
HareeshMR
(Hareesh Madasi)
May 15, 2019, 5:16pm
11
Let me know if it is working @kyqurikan
@kyqurikan ,
Can you please try this one.
"{parentID: FEF98F4245FABCCFB2DA03FDFC254717B94CC7FC3C29}”
I hope this will work.
@kyqurikan ,
May I know whether this way is working?
"{parentID: FEF98F4245FABCCFB2DA03FDFC254717B94CC7FC3C29}”
Thanks,
Arunachalam
kyqurikan
(Brian Bennett)
May 15, 2019, 5:48pm
16
No.
Main.xaml (13.2 KB)
project.json (881 Bytes)
@kyqurikan
I’m working on your problem Can you please share me the supported PDF file. Because sample PDF file is not recognized.
Thanks,
Arunachalam.
kyqurikan
(Brian Bennett)
May 15, 2019, 6:12pm
19
@kyqurikan ,
Can you please change the Accept Format as JSON and try.
Thanks,
Arunachalam