HTTP call. Use this for all HTTP calls as a client
import edu.internet2.middleware.grouper.util.*;
GrouperHttpClient grouperHttpCall = new GrouperHttpClient(); grouperHttpCall.assignUrl(url); grouperHttpCall.assignGrouperHttpMethod("POST"); grouperHttpCall.addHeader("Content-Type", "application/json"); grouperHttpCall.addHeader("Authorization", "Bearer " + bearerToken); grouperHttpCall.assignBody(body); grouperHttpCall.executeRequest(); if (grouperHttpCall.getResponseCode() != 200) { throw new RuntimeException("Error connecting to '" + url + "': " + grouperHttpCall.getResponseCode()); } String json = grouperHttpCall.getResponseBody();