From f4df63e448c9bcd990ec9a41eb6cb19a36246099 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Thu, 4 May 2017 18:35:53 +0200 Subject: adding support for transaction history to wire plugin API (#4959) --- src/bank-lib/bank_api_common.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'src/bank-lib/bank_api_common.c') diff --git a/src/bank-lib/bank_api_common.c b/src/bank-lib/bank_api_common.c index 0476379d8..e68ba41b5 100644 --- a/src/bank-lib/bank_api_common.c +++ b/src/bank-lib/bank_api_common.c @@ -85,4 +85,32 @@ TALER_BANK_make_auth_header_ (const struct TALER_BANK_AuthenticationData *auth) return authh; } + + +/** + * Obtain the URL to use for an API request. + * + * @param u base URL of the bank + * @param path Taler API path (i.e. "/history") + * @return the full URI to use with cURL + */ +char * +TALER_BANK_path_to_url_ (const char *u, + const char *path) +{ + char *url; + + if ( ('/' == path[0]) && + (0 < strlen (u)) && + ('/' == u[strlen (u) - 1]) ) + path++; /* avoid generating URL with "//" from concat */ + GNUNET_asprintf (&url, + "%s%s", + u, + path); + return url; +} + + + /* end of bank_api_common.c */ -- cgit v1.2.3