EDataServer.WebDAVSession.get_data_sync

### Method

# EDataServer WebDAVSessionget_data_sync

since: 3.26

#### Declaration [src]

    gboolean
    e_webdav_session_get_data_sync (
      EWebDAVSession* webdav,
      const gchar* uri,
      gchar** out_href,
      gchar** out_etag,
      SoupMessageHeaders** out_headers,
      gchar** out_bytes,
      gsize* out_length,
      GCancellable* cancellable,
      GError** error
    )

#### Description [src]

Reads a resource identified by `uri` from the server. The URI cannot reference a collection.

The `out_bytes` is filled by actual data being read. If not `NULL`, `out_length` is populated with how many bytes had been read. The `out_bytes` is always NUL-terminated, while this termination byte is not part of `out_length`. Free the `out_bytes` with g_free(), when no longer needed.

Free returned pointer of `out_href` and `out_etag`, if not `NULL`, with g_free(), when no longer needed.

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

To read large data use `e_webdav_session_get_sync()` instead.

Available since: 3.26

#### Parameters

`uri`

  Type: `const gchar*`

  URI of the resource to read.

  The data is owned by the caller of the method.
  The value is a NUL terminated UTF-8 string.

`out_href`

  Type: `gchar**`

  Optional return location for href of the resource, or `NULL`.

  The argument will be set by the function.
  The argument can be set to `NULL` by the method.
  The caller of the method takes ownership of the returned data, and is responsible for freeing it.
  The value is a NUL terminated UTF-8 string.

`out_etag`

  Type: `gchar**`

  Optional return location for etag of the resource, or `NULL`.

  The argument will be set by the function.
  The argument can be set to `NULL` by the method.
  The caller of the method takes ownership of the returned data, and is responsible for freeing it.
  The value is a NUL terminated UTF-8 string.

`out_headers`

  Type: `SoupMessageHeaders`

  Optional return location for response `SoupMessageHeaders`, or `NULL`.

  The argument will be set by the function.
  The argument can be `NULL`.
  The caller of the method takes ownership of the returned data, and is responsible for freeing it.

`out_bytes`

  Type: `gchar**`

  Return location for bytes being read.

  The argument will be set by the function.
  The caller of the method takes ownership of the returned data, and is responsible for freeing it.
  The value is a NUL terminated UTF-8 string.

`out_length`

  Type: `gsize*`

  Option return location for length of bytes being read, or `NULL`.

  The argument will be set by the function.
  The argument can be set to `NULL` by the method.

`cancellable`

  Type: `GCancellable`

  Optional `GCancellable` object, or `NULL`.

  The argument can be `NULL`.
  The data is owned by the caller of the method.

`error`

  Type: `GError **`

  The return location for a recoverable error.

  The argument can be `NULL`.
  If the return location is not `NULL`, then you must initialize it to a `NULL` `GError*`.
  The argument will be left initialized to `NULL` by the method if there are no errors.
  In case of error, the argument will be set to a newly allocated `GError`; the caller will take ownership of the data, and be responsible for freeing it.

#### Return value

Type: `gboolean`

Whether succeeded.