add usage for clickhouse rest handler
@@ -49,13 +49,13 @@ impl HttpHandler {
})
}
- // TODO(younsofun): add doc url after it`s ready
pub fn usage(sock: SocketAddr) -> String {
+ let json = r#"{"foo": "bar"}"#;
format!(
r#" examples:
-curl --request POST '{:?}/v1/statement/' --header 'Content-Type: text/plain' --data-raw 'SELECT avg(number) FROM numbers(100000000)'
-curl --request POST '{:?}/v1/query/' --header 'Content-Type: application/json' --data-raw '{{"sql": "SELECT avg(number) FROM numbers(100000000)"}}'"#,
- sock, sock
+curl --request POST '{:?}/v1/query/' --header 'Content-Type: application/json' --data-raw '{{"sql": "SELECT avg(number) FROM numbers(100000000)"}}'
+echo '{}' | curl '{:?}/clickhouse/?query=INSERT%20INTO%20test%20FORMAT%20JSONEachRow' --data-binary @-"#,
+ sock, json, sock
)
}
