MCPcopy Create free account
hub / github.com/Asana/java-asana / versionHeader

Method versionHeader

src/main/java/com/asana/Client.java:244–262  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

242
243
244 private String versionHeader() {
245 StringBuilder builder = new StringBuilder();
246 HashMap<String, String> values = new HashMap<String, String>();
247 values.put("version", clientVersion());
248 values.put("language", "Java");
249 values.put("language_version", System.getProperty("java.version"));
250 values.put("os", System.getProperty("os.name"));
251 values.put("os_version", System.getProperty("os.version"));
252 for (Map.Entry<String, String> entry : values.entrySet()) {
253 //some of the values above aren't defined on all platforms; URLEncoder chokes on null
254 if (entry.getValue() != null) {
255 builder.append("&");
256 builder.append(URLEncoder.encode(entry.getKey()));
257 builder.append("=");
258 builder.append(URLEncoder.encode(entry.getValue()));
259 }
260 }
261 return builder.toString().substring(1);
262 }
263
264 /**
265 * WARNING: API Keys are deprecated and have been removed from Asana's API.

Callers 1

requestMethod · 0.95

Calls 2

clientVersionMethod · 0.95
toStringMethod · 0.80

Tested by

no test coverage detected