mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-28 01:40:33 +01:00
We'll need to be able to issue PUT calls. Conflicts: code formatting, missing nmcs-provider-aliyun, azure and gcp. Missing commit494819bbbf("cloud-setup: move common code for get_config() to base class and improve cancellation") (cherry picked from commitcd74d75002) (cherry picked from commiteff4372045) (cherry picked from commitaaf66e9174) (cherry picked from commit3d94f4fdf9) (cherry picked from commit181466c6da) (cherry picked from commit7243307bb8) (cherry picked from commit1aa88024cb) (cherry picked from commit59b5a8fdcb) (cherry picked from commit0962b6e23d) (cherry picked from commitb31caa6d6a) (cherry picked from commit10ff5f0957)
55 lines
2.6 KiB
C
55 lines
2.6 KiB
C
// SPDX-License-Identifier: LGPL-2.1+
|
|
|
|
#ifndef __NM_HTTP_CLIENT_C__
|
|
#define __NM_HTTP_CLIENT_C__
|
|
|
|
/*****************************************************************************/
|
|
|
|
typedef struct _NMHttpClient NMHttpClient;
|
|
typedef struct _NMHttpClientClass NMHttpClientClass;
|
|
|
|
#define NM_TYPE_HTTP_CLIENT (nm_http_client_get_type ())
|
|
#define NM_HTTP_CLIENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_HTTP_CLIENT, NMHttpClient))
|
|
#define NM_HTTP_CLIENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_HTTP_CLIENT, NMHttpClientClass))
|
|
#define NM_IS_HTTP_CLIENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_HTTP_CLIENT))
|
|
#define NM_IS_HTTP_CLIENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_HTTP_CLIENT))
|
|
#define NM_HTTP_CLIENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_HTTP_CLIENT, NMHttpClientClass))
|
|
|
|
GType nm_http_client_get_type (void);
|
|
|
|
NMHttpClient *nm_http_client_new (void);
|
|
|
|
/*****************************************************************************/
|
|
|
|
GMainContext *nm_http_client_get_main_context (NMHttpClient *self);
|
|
|
|
/*****************************************************************************/
|
|
|
|
typedef gboolean (*NMHttpClientPollReqCheckFcn) (long response_code,
|
|
GBytes *response_data,
|
|
gpointer check_user_data,
|
|
GError **error);
|
|
|
|
void nm_http_client_poll_req (NMHttpClient *self,
|
|
const char *uri,
|
|
int request_timeout_ms,
|
|
gssize request_max_data,
|
|
int poll_timeout_ms,
|
|
int ratelimit_timeout_ms,
|
|
const char *const *http_headers,
|
|
const char *http_method,
|
|
GCancellable *cancellable,
|
|
NMHttpClientPollReqCheckFcn check_fcn,
|
|
gpointer check_user_data,
|
|
GAsyncReadyCallback callback,
|
|
gpointer user_data);
|
|
|
|
gboolean nm_http_client_poll_req_finish (NMHttpClient *self,
|
|
GAsyncResult *result,
|
|
long *out_response_code,
|
|
GBytes **out_response_data,
|
|
GError **error);
|
|
|
|
/*****************************************************************************/
|
|
|
|
#endif /* __NM_HTTP_CLIENT_C__ */
|