Top |
GrlNetWc * | grl_net_wc_new () |
GQuark | grl_net_wc_error_quark () |
void | grl_net_wc_flush_delayed_requests () |
void | grl_net_wc_request_async () |
gboolean | grl_net_wc_request_finish () |
void | grl_net_wc_request_with_headers_async () |
void | grl_net_wc_request_with_headers_hash_async () |
void | grl_net_wc_set_cache () |
void | grl_net_wc_set_cache_size () |
void | grl_net_wc_set_log_level () |
void | grl_net_wc_set_throttling () |
Most of the Grilo's sources need to access to web resources. The purpose of this utility class is to provide a thin and lean mechanism for those plugins to interact with those resources.
void
grl_net_wc_flush_delayed_requests (GrlNetWc *self
);
This method will flush all the pending request in the queue.
void grl_net_wc_request_async (GrlNetWc *self
,const char *uri
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Request the fetching of a web resource given the uri
. This request is
asynchronous, thus the result will be returned within the callback
.
self |
a GrlNetWc instance |
|
uri |
The URI of the resource to request |
|
cancellable |
a GCancellable instance or |
[allow-none] |
callback |
The callback when the result is ready |
|
user_data |
User data set for the |
gboolean grl_net_wc_request_finish (GrlNetWc *self
,GAsyncResult *result
,gchar **content
,gsize *length
,GError **error
);
Finishes an asynchronous load of the file's contents. The contents are placed in contents, and length is set to the size of the contents string.
The content address will be invalidated at the next request. So if you want to keep it, please copy it into another address.
self |
a GrlNetWc instance |
|
result |
The result of the request |
|
content |
The contents of the resource. |
[out][allow-none][transfer none] |
length |
The length of the contents or |
[out][allow-none] |
error |
return location for a GError, or |
void grl_net_wc_request_with_headers_async (GrlNetWc *self
,const char *uri
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
,...
);
Request the fetching of a web resource given the uri
. This request is
asynchronous, thus the result will be returned within the callback
.
self |
a GrlNetWc instance |
|
uri |
The URI of the resource to request |
|
cancellable |
a GCancellable instance or |
[allow-none] |
callback |
The callback when the result is ready |
|
user_data |
User data set for the |
|
... |
List of tuples of header name and header value, terminated by
|
Since: 0.2.2
void grl_net_wc_request_with_headers_hash_async (GrlNetWc *self
,const char *uri
,GHashTable *headers
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Request the fetching of a web resource given the uri
. This request is
asynchronous, thus the result will be returned within the callback
.
[rename-to grl_net_wc_request_with_headers_async]
self |
a GrlNetWc instance |
|
uri |
The URI of the resource to request |
|
headers |
a set of additional HTTP
headers for this request or |
[allow-none][element-type utf8 utf8] |
cancellable |
a GCancellable instance or |
[allow-none] |
callback |
The callback when the result is ready |
|
user_data |
User data set for the |
Since: 0.2.2
void grl_net_wc_set_cache (GrlNetWc *self
,gboolean use_cache
);
Sets if cache must be used. Note that this will only work if caching is
supporting. If sets TRUE
, a new cache will be created. If sets to FALSE
,
current cache is clean and removed.
Since: 0.1.12
void grl_net_wc_set_cache_size (GrlNetWc *self
,guint cache_size
);
Sets the new maximum size of cache, in Megabytes. Default value is 10. Using 0 means no cache will be done.
Since: 0.1.12
void grl_net_wc_set_log_level (GrlNetWc *self
,guint log_level
);
Setting the log level the logger feature is added into the libsoup session.
struct GrlNetWcClass { GObjectClass parent_class; };
Grilo web client helper class.
It's a simple and thin web client to be used by the sources to download content from Internet.
These constants identify all the available errors managed by the web client.