Function

RestParamnew_full

Declaration [src]

RestParam*
rest_param_new_full (
  const char* name,
  RestMemoryUse use,
  gconstpointer data,
  gsize length,
  const char* content_type,
  const char* filename
)

Description [src]

Create a new RestParam called name with length bytes of data as the value. content_type is the type of the data as a MIME type, for example “text/plain” for simple string parameters.

If the parameter is a file upload it can be passed as filename.

Parameters

name const char*
 

The parameter name.

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

The RestMemoryUse describing how the memory can be used.

data An array of guint8
 

A pointer to the start of the data.

 The length of the array is specified in the length argument.
length gsize
 

The length of the data.

content_type const char*
 

The content type of the data.

 The data is owned by the caller of the function.
 The value is a NUL terminated UTF-8 string.
filename const char*
 

The original filename, or NULL.

 The argument can be NULL.
 The data is owned by the caller of the function.
 The value is a NUL terminated UTF-8 string.

Return value

Returns: RestParam
 

A new RestParam.

 The caller of the function takes ownership of the data, and is responsible for freeing it.