コード例 #1
0
  private static String requestWithAuth(Context context, String method, String path, String content)
      throws IOException, AuthenticationException {
    String authToken = null;
    if (context != null) {
      authToken = getAuthenticationToken(context);
    }

    ServerRequest serverRequest = new ServerRequest(APPKEY, authToken);
    return serverRequest.request(method, ROOTAPIPATH + path, content);
  }
コード例 #2
0
  public static HttpURLConnection setupConnectionWithAuth(
      Context context, String method, String path, String content)
      throws IOException, AuthenticationException {
    String authToken = null;
    if (context != null) {
      authToken = getAuthenticationToken(context);
    }

    ServerRequest serverRequest = new ServerRequest(APPKEY, authToken);
    return serverRequest.setupConnection(method, ROOTAPIPATH + path, content);
  }