dosubot[bot] commented on issue #713: URL: https://github.com/apache/incubator-hugegraph-toolchain/issues/713#issuecomment-3948755168
<!-- Greeting --> Hi @chgjin! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the incubator-hugegraph-toolchain team. <!-- Answer --> 感谢你的报告!这确实是一个 bug。 在 [`GraphsAPI.java` 的 `create` 方法中](https://github.com/apache/incubator-hugegraph-toolchain/blob/9696d78e4d0b6e10d4e3382248fd8bda61295a91/hugegraph-client/src/main/java/org/apache/hugegraph/api/graphs/GraphsAPI.java#L75-L85),第 77 行明确将 Content-Type 设置为 `"text/plain"`: ```java RestHeaders headers = new RestHeaders().add(RestHeaders.CONTENT_TYPE, "text/plain"); ``` 然而,[HugeGraph REST API 要求所有请求使用 `application/json` 作为 Content-Type](https://hugegraph.apache.org/docs/guides/faq/),这就导致了 HTTP 415 错误。 修复方案应该是将 `"text/plain"` 改为 `"application/json"`。 <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/afa42056-1299-4f45-9a23-37d6700b3150?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/afa42056-1299-4f45-9a23-37d6700b3150?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/afa42056-1299-4f45-9a23-37d6700b3150?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/afa42056-1299-4f45-9a23-37d6700b3150?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/afa42056-1299-4f45-9a23-37d6700b3150?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/afa42056-1299-4f45-9a23-37d6700b3150?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/afa42056-1299-4f45-9a23-37d6700b3150?feedback_type=other)</sup> [](https://app.dosu.dev/e5e246fa-a522-4d8a-ab3c-e2588b5b501b/ask?utm_source=github) [](https://cursor.com/link/prompt?text=%E6%84%9F%E8%B0%A2%E4%BD%A0%E7%9A%84%E6%8A%A5%E5%91%8A%EF%BC%81%E8%BF%99%E7%A1%AE%E5%AE%9E%E6%98%AF%E4%B8%80%E4%B8%AA%20bug%E3%80%82%0A%0A%E5%9C%A8%20%5B%60GraphsAPI.java%60%20%E7%9A%84%20%60create%60%20%E6%96%B9%E6%B3%95%E4%B8%AD%5D%28https%3A//github.com/apache/incubator-hugegraph-toolchain/blob/9696d78e4d0b6e10d4e3382248fd8bda61295a91/hugegraph-client/src/main/java/org/apache/hugegraph/api/graphs/GraphsAPI.java%23L75-L85%29%EF%BC%8C%E7%AC%AC%2077%20%E8%A1%8C%E6%98%8E%E7%A1%AE%E5%B0%86%20Content-Type%20%E8%AE%BE%E7%BD%AE%E4%B8%BA%20%60%22text/plain%22%60%EF%BC%9A%0A%0A%60%60%60java%0ARestHeaders%20headers%20%3D%20new%20RestHeaders%28%29.add%28RestHeaders.CONTENT_TYPE%2C%20%22text/plain%22%29%3B%0A%60%60%60%0A%0A%E7%84%B6%E8%80%8C%EF%BC%8C%5BHugeG raph%20REST%20API%20%E8%A6%81%E6%B1%82%E6%89%80%E6%9C%89%E8%AF%B7%E6%B1%82%E4%BD%BF%E7%94%A8%20%60application/json%60%20%E4%BD%9C%E4%B8%BA%20Content-Type%5D%28https%3A//hugegraph.apache.org/docs/guides/faq/%29%EF%BC%8C%E8%BF%99%E5%B0%B1%E5%AF%BC%E8%87%B4%E4%BA%86%20HTTP%20415%20%E9%94%99%E8%AF%AF%E3%80%82%0A%0A%E4%BF%AE%E5%A4%8D%E6%96%B9%E6%A1%88%E5%BA%94%E8%AF%A5%E6%98%AF%E5%B0%86%20%60%22text/plain%22%60%20%E6%94%B9%E4%B8%BA%20%60%22application/json%22%60%E3%80%82) [](https://go.dosu.dev/discord-bot) [](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/incubator-hugegraph-toolchain/issues/713) -- 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]
