put_sync


Description:

public bool put_sync (string uri, string? etag, string content_type, MessageHeaders? in_headers, InputStream stream, ssize_t stream_length, out string? out_href, out string? out_etag, out MessageHeaders out_headers, Cancellable? cancellable = null) throws Error

Writes data from stream to a resource identified by uri to the server.

The URI cannot reference a collection.

The etag argument is used to avoid clashes when overwriting existing resources. It can contain three values: - null - to write completely new resource - empty string - write new resource or overwrite any existing, regardless changes on the server - valid ETag - overwrite existing resource only if it wasn't changed on the server.

Note that the actual behaviour is also influenced by avoid_ifmatch property of the associated Source.

The optional in_headers can contain additional headers to be added to the request. These headers replace any existing in the request headers, without support for the list-values headers.

The out_href, if provided, is filled with the resulting URI of the written resource. It can be different from the uri when the server redirected to a different location.

The out_etag contains ETag of the resource after it had been saved.

The optional out_headers contains response headers. Free it with soup_message_headers_free, when no longer needed.

The stream should support also Seekable interface, because the data send can require restart of the send due to redirect or other reasons.

This method uses Transfer-Encoding:chunked, in contrast to the put_data_sync, which writes data stored in memory like any other request.

Parameters:

this

an WebDAVSession

uri

URI of the resource to write

etag

an ETag of the resource, if it's an existing resource, or null

content_type

Content-Type of the bytes to be written

in_headers

additional MessageHeaders to be added to the request, or null

stream

a InputStream with data to be written

stream_length

length of the stream, or -1 if unknown

out_href

optional return location for href of the resource, or null

out_etag

optional return location for etag of the resource, or null

out_headers

optional return location for response MessageHeaders, or null

cancellable

optional Cancellable object, or null

Returns:

Whether succeeded.