I created a topic, test-topic, successfully. When I attempt to produce data for the topic with the curl command:
curl -v -X POST -H "Content-Type: application/json" -H "Accept: application/json" \
--data '{"records":[{"key":"jsmith","value":"alarm clock"}, \
{"key":"htanaka","value":"batteries"},{"key":"awalther","value":"bookshelves"}]}' \
"http://localhost:8082/topics/test-topic"
I get the following response:
{"error_code":415,"message":"HTTP 415 Unsupported Media Type"}
I see this exception in the Docker log:
rest-proxy | [2023-07-08 07:40:46,829] ERROR Request Failed with exception (io.confluent.rest.exceptions.DebuggableExceptionMapper) rest-proxy | javax.ws.rs.NotSupportedException: HTTP 415 Unsupported Media Type rest-proxy | at org.glassfish.jersey.server.internal.routing.MethodSelectingRouter.getMethodRouter(MethodSelectingRouter.java:421)... POST /topics/test-topic HTTP/1.1" 415 62 "-" "curl/7.87.0" 4 (io.confluent.rest-utils.requests)
Tried changing Content-Type: "Content-Type: application/vnd.kafka.json.v3+json", but behaved the same.
Any insights appreciated.
See the README.md for the REST Proxy. The format and URL for the V3 API is different from the V2. Confluent's QuickStart pages have not been updated.
Here's a V3 curl post of a single data value:
Here's a V3 curl post of multiple data values: