package com.google.sps.servlets;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.google.sps.data.GetAPIKeyUtil;
import java.io.IOException;
import java.io.FileNotFoundException;
import java.util.Map;
import java.util.HashMap;
import java.lang.reflect.Type;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.google.sps.data.UrlRequest;

/** Servlet that gets civic information. */
@WebServlet("/actions/civic")
public class CivicServlet extends HttpServlet {

  private static String API_KEY;
  private static final String API_PATH = "https://www.googleapis.com/civicinfo/v2/representatives";

  @Override
  public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
    GetAPIKeyUtil util = new GetAPIKeyUtil();
    API_KEY = util.getAPIKey("google");
    String address = request.getParameter("address");
    Map<String, String> queryParams = new HashMap<>();
    queryParams.put("key", API_KEY);
    queryParams.put("address", address);
    queryParams.put("prettyPrint", "false");
    String jsonResult = UrlRequest.urlQuery(API_PATH, queryParams);
    System.out.println("json is: " + jsonResult);
    response.setContentType("application/json;");
    response.getWriter().println(jsonResult);    
  }
}

@@ -1259,58 +1259,8 @@
 s);%0A
-    System.out.println(%22json is: %22 + jsonResult);%0A
     
@@ -1350,19 +1350,15 @@
 Result);
-    
 %0A  %7D%0A%7D%0A

Remove Trailing Whiespace