3

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.

Riduidel
  • 22,052
  • 14
  • 85
  • 185
satyam bansal
  • 31
  • 1
  • 4

1 Answers1

5

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="}]}
Edoardo Comar
  • 531
  • 2
  • 5