returns content-type as json if possible

Signed-off-by: frank chen <frank.chen021@outlook.com>
This commit is contained in:
frank chen 2021-12-02 13:25:17 +08:00
parent 1f9b542ee9
commit c49a7251ed

View File

@ -23,6 +23,13 @@ public:
String getName() const override { return "JSONEachRowRowOutputFormat"; }
public:
/// Content-Type to set when sending HTTP response.
String getContentType() const override
{
return settings.json.array_of_rows ? "application/json; charset=UTF-8" : IRowOutputFormat::getContentType();
}
protected:
void writeField(const IColumn & column, const ISerialization & serialization, size_t row_num) override;
void writeFieldDelimiter() override;