put_sync
Description:
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 | |
uri |
URI of the resource to write |
etag |
an ETag of the resource, if it's an existing resource, or |
content_type |
Content-Type of the |
in_headers |
additional MessageHeaders to be added to the request, or |
stream |
a InputStream with data to be written |
stream_length |
length of the |
out_href |
optional return location for href of the resource, or |
out_etag |
optional return location for etag of the resource, or |
out_headers |
optional return location for response MessageHeaders, or |
cancellable |
optional Cancellable object, or |
Returns:
Whether succeeded. |