private static void postRest(String endpoint, String payload, boolean isViaRouter){
        try {

            URL url = new URL(endpoint);
            HttpURLConnection conn = (HttpURLConnection) url.openConnection();
            conn.setDoOutput(true);
            conn.setRequestMethod("POST");
            conn.setRequestProperty("Content-Type", "application/json");
            if (!isViaRouter){
                conn.setRequestProperty("X-Test", "testskipapigee");
            }else{
                conn.setRequestProperty("X-Nike-Authorization", "Bearer eyJhbGciOiJSUzI1NiJ9.eyJzY3AiOlsicmVhZCIsIndyaXRlIl0sImV4cCI6MTQ1MjYxODMzOCwic3ViIjoiZXNiIiwiYXVkIjpbIm5vdGlmaWNhdGlvbnJvdXRlciJdLCJpc3MiOiJlc2IifQ.XhrG_Nb_qsZO0KdVbctlsz8Lw8SMYn_sthhgWDeQotleE19StaBI1xJJUKPbOQV_oBqDKbZyvzYiDLgtY2BQ787tsVSrM4CLHQ7Jniia-wYugABSW1kjOqidxxbVEC5mJzUWQzT4pbv-pdnL3wB-EUGL06L5EYaZ_Z7U3aHELLEHxLHkr4aW-KHScIYNSIV6hl6pNM4X6da9po7ezxZRAZmG0ngfvAy5kCwSQaapj3lboa97jlDDvwIagVzHqHuE3ZfC38vnKVbLmBo48-840JuFH0sT3vKXsEchPhFvZYeH1dXxaenJWANMPrSRFZ6BPejYV9WshPzaHMeMfZw0tg");
                        conn.setRequestProperty("X-Nike-AppId", "esb");
            }

            OutputStream os = conn.getOutputStream();
            os.write(payload.getBytes());
            os.flush();

            StringBuilder builder = new StringBuilder();
            builder.append(conn.getResponseCode())
                    .append(" ")
                    .append(conn.getResponseMessage())
                    .append("\n");

            Map<String, List<String>> map = conn.getHeaderFields();
            for (Map.Entry<String, List<String>> entry : map.entrySet())
            {
                if (entry.getKey() == null)
                    continue;
                builder.append( entry.getKey())
                        .append(": ");

                List<String> headerValues = entry.getValue();
                Iterator<String> it = headerValues.iterator();
                if (it.hasNext()) {
                    builder.append(it.next());

                    while (it.hasNext()) {
                        builder.append(", ")
                                .append(it.next());
                    }
                }

                builder.append("\n");
            }
            System.out.println(builder);

            conn.disconnect();

        } catch (MalformedURLException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }

    }