Why Kafka REST Proxy API not Consuming data in JSON Format?

3.7k views Asked by At

I'm try to access message hub instance by using kafka rest API. when i'm sending post request through Postman Client and giving Content-Type as application/vnd.kafka.json.v1+json it's giving me the following response

{
  "error_code": 415,
  "message": "HTTP 415 Unsupported Media Type"
}

could anyone please help me with that?. I'm also passing api key in X-Auth-Token Header.

1

There are 1 answers

0
Edoardo Comar On

the accepted content-types when producing messages are

"application/vnd.kafka.binary.v1+json"
"application/vnd.kafka.v1+json"
"application/vnd.kafka+json"
"application/json"

but in all cases, the Message Hub REST service expects the content to be formatted as

"application/vnd.kafka.binary.v1+json"

i.e. the value of "value" to be base64-encoded. E.g. something like

{"records":[{"value":"YmxhaGJsYWg="}]}