Skip to content

Commit b7247b8

Browse files
authored
Support post with no body for APIs (#262)
## Changes The upcoming Marketplace API introduces an API to create an analytics dashboard. This creation request is kind of a singleton, as it has no parameters. To support this, we introduce a `POST()` method with no body specified so that this resource can be created. ## Tests <!-- How is this tested? -->
1 parent 51a5c75 commit b7247b8

File tree

1 file changed

+8
-0
lines changed
  • databricks-sdk-java/src/main/java/com/databricks/sdk/core

1 file changed

+8
-0
lines changed

databricks-sdk-java/src/main/java/com/databricks/sdk/core/ApiClient.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,14 @@ public <I, O> O GET(String path, I in, Class<O> target, Map<String, String> head
142142
}
143143
}
144144

145+
public <O> O POST(String path, Class<O> target, Map<String, String> headers) {
146+
try {
147+
return execute(prepareRequest("POST", path, null, headers), target);
148+
} catch (IOException e) {
149+
throw new DatabricksException("IO error: " + e.getMessage(), e);
150+
}
151+
}
152+
145153
public <I, O> O POST(String path, I in, Class<O> target, Map<String, String> headers) {
146154
try {
147155
return execute(prepareRequest("POST", path, in, headers), target);

0 commit comments

Comments
 (0)