Pregunta

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.

¿Fue útil?

Solución

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.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top