From 00de759cafffd6c08bd100245743c6f9d328bda4 Mon Sep 17 00:00:00 2001 From: Pierre Date: Sun, 7 Jan 2018 12:14:06 +0100 Subject: [PATCH] Added functions to make request easier --- .../client/api/APIRequestParameters.java | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/app/src/main/java/org/communiquons/android/comunic/client/api/APIRequestParameters.java b/app/src/main/java/org/communiquons/android/comunic/client/api/APIRequestParameters.java index 8c7767c..3fb8c73 100644 --- a/app/src/main/java/org/communiquons/android/comunic/client/api/APIRequestParameters.java +++ b/app/src/main/java/org/communiquons/android/comunic/client/api/APIRequestParameters.java @@ -58,6 +58,26 @@ public class APIRequestParameters { parameters.add(new APIPostData(name, value)); } + /** + * Add a new parameter to the request + * + * @param name The name of the new key + * @param value The value of the new key (int) + */ + public void addParameter(String name, int value){ + this.addParameter(name, ""+value); + } + + /** + * Add a new parameter to the request + * + * @param name The name of the new key + * @param value The value of the new key (boolean) + */ + public void addParameter(String name, boolean value){ + this.addParameter(name, value ? "true" : "false"); + } + /** * Retrieve request URI *