Skip to content

Instantly share code, notes, and snippets.

@HawaiiRyan
Created January 4, 2022 19:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save HawaiiRyan/4396572e8e76dc02c70e1c5c4b7dafe0 to your computer and use it in GitHub Desktop.
Save HawaiiRyan/4396572e8e76dc02c70e1c5c4b7dafe0 to your computer and use it in GitHub Desktop.
package com.vmware;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import java.io.IOException;
public class restexample {
public static void main(String[] args) {
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
Request request = new Request.Builder()
.url("https://ws1.ryanpringnitz.com/API/mdm/devices/search")
.method("GET", null)
.addHeader("aw-tenant-code", "a/APIKEYEXAMPLE/=")
.addHeader("Content-Type", "application/json")
.addHeader("Authorization", "Basic BASICHEADERAUTHEXAMPLE=")
.build();
Response response = null;
try {
response = client.newCall(request).execute();
} catch (IOException e) {
e.printStackTrace();
}
System.out.println("Workspace ONE UEM REST API Response: " + response);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment