Get the length of the content of param
.
Get the MIME type of the parameter. For example, basic strings have the MIME type "text/plain".
Get the original file name of the parameter, if one is available.
Get the name of the parameter.
Determine if the parameter is a string value, i.e. the content type is "text/plain".
Decrease the reference count on param,
destroying it if the reference count
reaches 0.
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
.
the parameter name
the #RestMemoryUse describing how the memory can be used
a pointer to the start of the data
the content type of the data
the original filename, or %NULL
A convience constructor to create a #RestParam from a given UTF-8 string. The resulting #RestParam will have a content type of "text/plain".
the parameter name
the #RestMemoryUse describing how the memory can be used
the parameter value
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
.
When the #RestParam is freed, it will call owner_dnotify,
passing owner
to
it. This allows you to do something like this:
|[ GMappedFile *map = g_mapped_file_new (filename, FALSE, &error); RestParam *param = rest_param_new_with_owner ("media", g_mapped_file_get_contents (map), g_mapped_file_get_length (map), "image/jpeg", filename, map, (GDestroyNotify)g_mapped_file_unref);
@constructor
@param name the parameter name
@param data a pointer to the start of the data
@param contentType the content type of the data
@param filename the original filename, or %NULL
@param owner pointer to an object that owns `data`
@param ownerDnotify a function to free/unref `owner` when the buffer is freed
Get the content of
param
. The content should be treated as read-only and not modified in any way.