the path refers to a file that is accessible to your filesystem. like a mounted drive.
> echo "hello worlds" | curl -X POST -F file=@- "http://localhost:5001/api/v0/add"
{"Name":"-","Hash":"QmZ4tDuvesekSs4qM5ZBKpXiZGun7S2CYtEZRB3DYXkjGx","Size":"21"}
> ipfs cat QmZ4tDuvesekSs4qM5ZBKpXiZGun7S2CYtEZRB3DYXkjGx
hello worlds
Thanks so much for the help.
I figured it out myself that when posting the file I can’t specify the parameters in the datacontent of the post request, at least it’s for me.
I figured out that in c# the request should be MultipartFormDataContent.
And you post it using
var dataContent = new MultipartFormDataContent();
var content = new StringContent("12345");
var res = await client.PostAsync(
$"{host}/api/v0/files/write?create=true&arg=/{filename that you want to create in ipfs MFS}",
dataContent);
dataContent.Add(content);
this shows it’s possible to put “hello world” to ipfs without creating “hello world.txt”