zhenyuT commented on code in PR #133:
URL:
https://github.com/apache/incubator-hugegraph-commons/pull/133#discussion_r1314276267
##########
hugegraph-common/src/main/java/org/apache/hugegraph/rest/RestClient.java:
##########
@@ -17,34 +17,32 @@
package org.apache.hugegraph.rest;
-import java.util.Map;
+import okhttp3.Headers;
-import jakarta.ws.rs.core.MultivaluedMap;
+import java.util.Map;
public interface RestClient {
/**
* Post method
*/
RestResult post(String path, Object object);
- RestResult post(String path, Object object, MultivaluedMap<String, Object>
headers);
Review Comment:
> 可以尝试使用这个MultiValuedMap:
https://commons.apache.org/proper/commons-collections/apidocs/org/apache/commons/collections4/MultiValuedMap.html
使用MultiValuedMap可以达到目的,但是从语义上来说,感觉不是特别友好。仅从实现来说,使用HashMap也一样可以达到目的,还不用额外引入ommons.collections4依赖(Map<String,
String>其实更合适点)。
个人觉得还是在common内封装一个Header对象更合适一点
##########
hugegraph-common/src/main/java/org/apache/hugegraph/rest/RestClient.java:
##########
@@ -17,34 +17,32 @@
package org.apache.hugegraph.rest;
-import java.util.Map;
+import okhttp3.Headers;
-import jakarta.ws.rs.core.MultivaluedMap;
+import java.util.Map;
public interface RestClient {
/**
* Post method
*/
RestResult post(String path, Object object);
- RestResult post(String path, Object object, MultivaluedMap<String, Object>
headers);
Review Comment:
> 可以尝试使用这个MultiValuedMap:
https://commons.apache.org/proper/commons-collections/apidocs/org/apache/commons/collections4/MultiValuedMap.html
使用MultiValuedMap可以达到目的,但是从语义上来说,感觉不是特别友好。仅从实现来说,使用HashMap也一样可以达到目的,还不用额外引入ommons.collections4依赖(Map<String,
String>其实更合适点)。
个人觉得还是在common内封装一个Header对象更合适一点
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]