Return codes
This commit is contained in:
parent
732590873e
commit
9c695fe0df
@ -82,6 +82,7 @@ type props struct {
|
|||||||
Size string `xml:"DAV: prop>getcontentlength,omitempty"`
|
Size string `xml:"DAV: prop>getcontentlength,omitempty"`
|
||||||
Modified string `xml:"DAV: prop>getlastmodified,omitempty"`
|
Modified string `xml:"DAV: prop>getlastmodified,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type response struct {
|
type response struct {
|
||||||
Href string `xml:"DAV: href"`
|
Href string `xml:"DAV: href"`
|
||||||
Props []props `xml:"DAV: propstat"`
|
Props []props `xml:"DAV: propstat"`
|
||||||
@ -323,7 +324,7 @@ func (c *Client) Write(path string, data []byte, _ os.FileMode) error {
|
|||||||
s := c.put(path, bytes.NewReader(data))
|
s := c.put(path, bytes.NewReader(data))
|
||||||
switch s {
|
switch s {
|
||||||
|
|
||||||
case 200, 201:
|
case 200, 201, 204:
|
||||||
return nil
|
return nil
|
||||||
|
|
||||||
case 409:
|
case 409:
|
||||||
@ -349,7 +350,7 @@ func (c *Client) WriteStream(path string, stream io.Reader, _ os.FileMode) error
|
|||||||
// TODO check if parent collection exists
|
// TODO check if parent collection exists
|
||||||
s := c.put(path, stream)
|
s := c.put(path, stream)
|
||||||
switch s {
|
switch s {
|
||||||
case 200, 201:
|
case 200, 201, 204:
|
||||||
return nil
|
return nil
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
Loading…
Reference in New Issue
Block a user