BewareMyPower opened a new issue #7625: URL: https://github.com/apache/pulsar/issues/7625
See: https://pulsar.apache.org/sink-rest-api/?version=2.6.0#operation/registerSink The doc of request body is > A JSON value presenting config payload of a Pulsar Sink. All available configuration options are: And the request sample is: ```json { "classname": "org.example.MySinkTest", "inputs": ["persistent://public/default/sink-input"], "processingGuarantees": "EFFECTIVELY_ONCE", "parallelism": 10 } ``` But if I changed the header to `Content-Type: application/json` and passed a JSON body, then a 415 response would be received. From the [source code](https://github.com/apache/pulsar/blob/master/pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/SinksBase.java#L71): ```java @Path("/{tenant}/{namespace}/{sinkName}") @Consumes(MediaType.MULTIPART_FORM_DATA) public void registerSink ``` the media type is `multipart/form-data`, and the body contains two parts. The JSON presentation of a `SinkConfig` object is just one part, the other part should be the octet stream of a NAR file or an url of package. The same goes for `updateSink` REST API. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: [email protected]
