Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 761
satyam bansal Avatar asked Dec 13 '25 00:12

satyam bansal


1 Answers

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="}]}
like image 104
Edoardo Comar Avatar answered Dec 15 '25 16:12

Edoardo Comar



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!