Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.HashMap;
- import java.util.Map;
- public class RestApiRequest {
- String path;
- String method;
- HashMap<String, String> params;
- public RestApiRequest(String path, String method, HashMap<String, String> params){
- this.path = path;
- this.method = method;
- this.params = params;
- }
- public String getParams(){
- String result = "";
- int n = params.entrySet().size();
- int i = 1;
- for ( Map.Entry<String, String> entry : params.entrySet()) {
- result+=entry.getKey() + "=" + entry.getValue();
- if (i<n)
- result += "&";
- i++;
- }
- return result;
- }
- public String getPath() {
- return path;
- }
- public String getMethod() {
- return method;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement