質問

When I try to curl using the -T option, I get an empty reply:

$ curl --digest -u me:pwd -H "Content-Type:application/xml" -T test.xml http://localhost:8085/
curl: (52) Empty reply from server

Anyone know the incantation? The server works fine when connecting to it from the WebDAV client built into MacOSX.

役に立ちましたか?

解決

By default curl sends Expect: Continue, but unfortunately java web containers don't play nicely with the Expect header. The simplest answer is to instruct curl not to send that header:

curl --digest -u a2 -H "Content-Type:application/xml" -H "Expect:" -T TestPBE-workspace.xml http://localhost:8080/users/a2/files2/

The better solution is to make expect:continue work, but from the research i've done it appears that depends on what web container you're using.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top