davidradl commented on code in PR #32: URL: https://github.com/apache/flink-connector-http/pull/32#discussion_r3116062079
########## docs/content.zh/docs/connectors/table/http.md: ########## @@ -472,6 +477,30 @@ another format name. | http.sink.writer.thread-pool.size | optional | Sets the size of pool thread for HTTP Sink request processing. Increasing this value would mean that more concurrent requests can be processed in the same time. If not specified, the default value of 1 thread will be used. | | http.sink.writer.request.mode | optional | Sets the Http Sink request submission mode. Two modes are available: `single` and `batch`. Defaults to `batch` if not specified. | | http.sink.request.batch.size | optional | Applicable only for `http.sink.writer.request.mode = batch`. Sets number of individual events/requests that will be submitted as one HTTP request by HTTP sink. The default value is 500 which is same as HTTP Sink `maxBatchSize` | +| http.sink.header.* | optional | Custom HTTP headers to be added to every sink request. Each header is specified as an individual property using the prefix `http.sink.header.`, followed by the header name. For example: `'http.sink.header.Content-Type' = 'application/json'`. Multiple headers can be defined by adding multiple properties with this prefix. | + +### Sink Http headers +It is possible to set custom HTTP headers that will be added to every HTTP request sent by the HTTP sink connector. +Headers are specified as individual properties using the prefix `http.sink.header.`, followed by the header name. + +> **Note:** As of [FLINK-HTTP-3], custom HTTP headers are formally supported as a `ConfigOption` (`http.sink.header.*`), +> enabling proper validation and discoverability of header configuration. + +Headers can be set using the HTTP sink table DDL: + +```roomsql +CREATE TABLE http_sink ( + id bigint, + some_field string +) WITH ( + 'connector' = 'http-async-sink', + 'url' = 'http://example.com/myendpoint', + 'format' = 'json', + 'http.sink.header.Content-Type' = 'application/json', + 'http.sink.header.Authorization' = 'Bearer my-token', Review Comment: fyi there is OIDC support for lookup joins - which uses bearer tokens under the covers. This is another candidate to be implemented for sinks. -- 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. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
