Hi Expert,
I am trying to send something to others.
The script is working fine when i run it directly on my server unix box :
curl -F data_1=A -F data_2=B -F data_3=@D:test\t1.json http://server/url
However, when i use pub.client:http, i am getting the error data_3 parameter empty.
It seems that data_3 should be a file, how do I set the data_3 parameter of pub.client:http to make it work? Or is there another way?
Hi Jenny,
It appears you may not be fully understanding what that curl command is doing. It is not the case that data_3 should be a file. Indeed, given the extension it is probable that data_3 should be a json string. When a curl command sees @D:test\t1.json it replaces that with the content of the local file at D:test\t1.json before sending it to http://server/url
If you want to do the same, you can use pub.file:getFile with loadAs set to âstringâ to read the json string from the file sitting on the integration server (see this), then map the content in body/string to data_3.
Hi Expert,
I did this at first, but I got this error data_3 parameter empty, so I thought the data_3 parameter had to be passed into a file. Yes,I donât know much about curl command.
Or what else could I do?
url:http://server/url
method:post
loadAs:bytes
headers/Content-Type: application/jsonătext/htmlătext/plain ďźIâve tried all three Settingsďź