I am writing a command line script to put events into a calendar using curl. I managed to get this working by first creating a temporary local calendar file and then uploading this file to the server using these commands:
$command > $localfile curl -T "$localfile" $url
This works perfectly, but I’d like to get rid of the local file. I’m looking for a way to pipe the output of $command straight to curl. Something like this:
$command | curl -T - $url
According to curl’s manual, the option
T - should be what is required: read from stdin instead from a file. But if I use that option, I get this response:
<?xml version="1.0" encoding="utf-8"?> <d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns"> <s:exception>Sabre\DAV\Exception\Conflict</s:exception> <s:message>PUT is not allowed on non-files.</s:message> </d:error>
Does any one know how to do this?