Soup.MultipartInputStream.next_part

### Method

# Soup MultipartInputStreamnext_part

#### Declaration [src]

    GInputStream*
    soup_multipart_input_stream_next_part (
      SoupMultipartInputStream* multipart,
      GCancellable* cancellable,
      GError** error
    )

#### Description [src]

Obtains an input stream for the next part.

When dealing with a multipart response the input stream needs to be wrapped in a `SoupMultipartInputStream` and this function or its async counterpart need to be called to obtain the first part for reading.

After calling this function, `soup_multipart_input_stream_get_headers()` can be used to obtain the headers for the first part. A read of 0 bytes indicates the end of the part; a new call to this function should be done at that point, to obtain the next part.

`error` will only be set if an error happens during a read, `NULL` is a valid return value otherwise.

#### Parameters

`cancellable`

  Type: `GCancellable`

  A `GCancellable`.

  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: `GInputStream`

A new `GInputStream`, or `NULL` if there are no more parts.

The caller of the method takes ownership of the returned data, and is responsible for freeing it.
The return value can be `NULL`.