put_data_sync


Description:

public bool put_data_sync (string uri, string? etag, string content_type, MessageHeaders? in_headers, string bytes, size_t length, out string? out_href, out string? out_etag, out MessageHeaders out_headers, Cancellable? cancellable = null) throws Error

Writes data 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 usage of etag 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.

To write large data use put_sync instead.

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

bytes

actual bytes to be written

length

how many bytes to write, or -1, when the bytes is NUL-terminated

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.