summaryrefslogtreecommitdiff
path: root/talermerchantdemos/httpcommon/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'talermerchantdemos/httpcommon/__init__.py')
-rw-r--r--talermerchantdemos/httpcommon/__init__.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/talermerchantdemos/httpcommon/__init__.py b/talermerchantdemos/httpcommon/__init__.py
index fca615f..1036f33 100644
--- a/talermerchantdemos/httpcommon/__init__.py
+++ b/talermerchantdemos/httpcommon/__init__.py
@@ -44,6 +44,7 @@ def backend_post(backend_url, endpoint, json):
json=response_json,
status_code=resp.status_code
)
+ print("Backend responds to {}: {}".format(final_url, str(response_json)))
return response_json
@@ -57,7 +58,7 @@ def backend_post(backend_url, endpoint, json):
def backend_get(backend_url, endpoint, params):
headers = {"Authorization": "ApiKey sandbox"}
final_url = urljoin(backend_url, endpoint)
- print("GETting: " + final_url)
+ print("GETting: " + final_url + " with params: " + str(params))
try:
resp = requests.get(
final_url, params=params, headers=headers
@@ -75,4 +76,8 @@ def backend_get(backend_url, endpoint, params):
json=response_json,
status_code=resp.status_code
)
+ print("Backend responds to {}: {}".format(final_url, str(response_json)))
return response_json
+
+def fallback_404(error):
+ return "Page not found"