ivankelly commented on a change in pull request #521: Issue 520: Add more http 
endpoint
URL: https://github.com/apache/bookkeeper/pull/521#discussion_r141278530
 
 

 ##########
 File path: 
bookkeeper-server/src/main/java/org/apache/bookkeeper/http/HttpConfigurationService.java
 ##########
 @@ -47,10 +46,35 @@ public HttpConfigurationService(ServerConfiguration conf) {
     @Override
     public HttpServiceResponse handle(HttpServiceRequest request) throws 
Exception {
         HttpServiceResponse response = new HttpServiceResponse();
-        Map<String, Object> configMap = toMap(conf);
-        String jsonResponse = JsonUtil.toJson(configMap);
-        response.setBody(jsonResponse);
-        return response;
+        // GET
+        if (HttpServer.Method.GET == request.getMethod()) {
+            Map<String, Object> configMap = toMap(conf);
+            String jsonResponse = JsonUtil.toJson(configMap);
+            response.setBody(jsonResponse);
+            return response;
+        } else if (HttpServer.Method.PUT == request.getMethod() ||
 
 Review comment:
   POST and PUT have different semantics in REST. Is this creating a new 
resource? If so it should be POST. If it's only for updating an existing 
resource, it should be PUT. Not sure we should care so much about that, but 
it's what the convention is.
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to