簡體   English   中英

Java-Neo4J Rest調用將標簽放置到節點

[英]Java - Neo4J Rest call to put labels to nodes

我一直在嘗試使用Neo4J Restful API在新創建的節點上放置標簽。 以下是我嘗試過的CURL請求。

 Client client = ClientBuilder.newClient(); WebTarget target = client.target("http://localhost:7474/db/data/"); String propertyUri_labels = "http://localhost:7474/db/data/node/9/labels"; Response response = target .path(propertyUri_labels) .request(MediaType.APPLICATION_JSON) .header("application/xml", "true") .accept(MediaType.APPLICATION_JSON) .put(Entity.entity("\\"" + "Artist" + "\\"", MediaType.APPLICATION_JSON_TYPE)); System.out.println( String.format( "PUT to [%s], status code [%d]", propertyUri_labels, response.getStatus() ) ); 

但是,我沒有成功,但是得到的狀態碼為[400]。 我的網址“ http:// localhost:7474 / db / data / node / 9 / labels ”有問題嗎?

請幫助。

謝謝!

嘗試POST而不是PUT。 檢查文檔=> http://neo4j.com/docs/rest-docs/current/#rest-api-node-labels

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM