Skip to content

Commit

Permalink
Added PATCH api in local server
Browse files Browse the repository at this point in the history
  • Loading branch information
harishb2k committed Jan 4, 2025
1 parent 52ae60a commit 65f566a
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,18 @@ public void handle(HttpExchange t) {
}
data.putAll(qp);
response = new StringHelper().stringify(data);
} else if ("PATCH".equals(t.getRequestMethod())) {
Map<String, Object> data = new HashMap<>();
data.put("method", "delete");
data.put("data", "some data");
if (!Strings.isNullOrEmpty(requestBody)) {
data.put("request_body", requestBody);
}
if (!Strings.isNullOrEmpty(headerString)) {
data.put("headers", headerString);
}
data.putAll(qp);
response = new StringHelper().stringify(data);
}

if (qp.containsKey("status")) {
Expand Down

0 comments on commit 65f566a

Please sign in to comment.