diff --git a/docs/reference/matrix-glib/matrix-glib-sections.txt b/docs/reference/matrix-glib/matrix-glib-sections.txt index 243b1dc..4e611ce 100644 --- a/docs/reference/matrix-glib/matrix-glib-sections.txt +++ b/docs/reference/matrix-glib/matrix-glib-sections.txt @@ -53,6 +53,7 @@ matrix_api_get_type
matrix-http-api +matrix_http_api_new matrix_http_api_get_validate_certificate matrix_http_api_set_validate_certificate diff --git a/src/matrix-http-api.c b/src/matrix-http-api.c index e2b90e3..09de4a9 100644 --- a/src/matrix-http-api.c +++ b/src/matrix-http-api.c @@ -255,6 +255,15 @@ matrix_http_api_init(MatrixHTTPAPI *api) NULL); } +/** + * matrix_http_api_new: + * @base_url: the URL to use as the API endpoint + * @token: (allow-none): an authorization token to use. If %NULL, + * requests that need authentication will fail + * + * Create a new #MatrixHTTPAPI object with the specified base URL, and + * an optional authorization token + */ MatrixHTTPAPI * matrix_http_api_new(const gchar *base_url, const gchar *token) { diff --git a/src/matrix-http-api.h b/src/matrix-http-api.h index 3b45672..4024cf1 100644 --- a/src/matrix-http-api.h +++ b/src/matrix-http-api.h @@ -49,6 +49,7 @@ void matrix_http_api_set_validate_certificate(MatrixHTTPAPI *api, gboolean validate_certificate); gboolean matrix_http_api_get_validate_certificate(MatrixHTTPAPI *api); +MatrixHTTPAPI *matrix_http_api_new(const gchar *base_url, const gchar *token); G_END_DECLS #endif /* __MATRIX_HTTP_API_H__ */