BreakMeEveryday commented on issue #2530:
URL: 
https://github.com/apache/incubator-hugegraph/issues/2530#issuecomment-2071220786

   @dosu Sorry, your answer is not working and there is no 4 parameters 
overload method with client.post(). This is my solution and it works.
   对不起,您的答案不起作用,并且没有带有 client.post() 的 4 个参数重载方法。这是我的解决方案,它有效。
   
   ```java
       /**
        * 该Test方法成功,url可以替换成你自己的路径,我只是用了常量定义,HttpUtil使用的是hutool 
5.8.27包,这个也可以自定义替换
        * */
       @Test
       public void createGraphUsingHttpUtil(){
           String url = ConstTransferPath.BASE_URL.getPath()
                   +ConstTransferPath.GRAPHS.getPath()
                   +"hugegraph2";
   
           String configInfo = 
"gremlin.graph=org.apache.hugegraph.auth.HugeFactoryAuthProxy\n" +
                   "backend=rocksdb\n" +
                   "serializer=binary\n" +
                   "store=hugegraph2\n" +
                   "rocksdb.data_path=./rks-data-2\n" +
                   "rocksdb.wal_path=./rks-data-2";
   
           try{
               String response = HttpUtil.createPost(url)
                                         .header("Content-Type", "text/plain") 
//Attention Please! The content-type is text/plain.
                                         .body(configInfo)
                                         .execute()
                                         .body();
               System.out.println(JSONUtil.toJsonPrettyStr(response));
           }catch (Exception e){
               log.error(e.getMessage());
           }
       }
   
   ```
   
   


-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to