Thanks, Andy. I have also tried to invoke curl via proc:execute():
proc:execute("curl",("-F", "data=@example.txt", "-F", "tagger=", "-F", "parser=", "http://lindat.mff.cuni.cz/services/udpipe/api/process" ))
The function works, but unfortunately the text inside the file is not recognized as UTF-8, and so I get al lot of gibberish in the result. At the beginning I though it was due to my MacOS configuration, but I experimented a lot, and the problem seems to depend on BaseX.
I run the basexgui (and basex) commands of the bin folder from my Terminal window and they should inherit the environment variables (and indeed proc:execute("locale") also shows the right UTF-8 values).
I will open a Github issue, unless I am missing something here.