我正在嘗試使用多個 -d 引數執行 curl 命令(如果可能的話)。下面是命令:
curl -X POST "localhost:8090/rest/myResource/myEndpoint?user=user01" \
-d 'agg={
"comm": {
"date_histogram": {
"field": "DERIVED_UNIFIED_TIMESTAMP",
"calendar_interval": "month"
}
}
}&
q={
"bool": {
"must": [
{
"terms": {
"COMM_TYPE": [
"call",
"email",
"message"
]
}
}
]
}
}'
使用上述格式,端點正確地看到“agg”引數,但“q”為空。
如果我將 -d 折疊為一行,它就可以作業。但是,我不想這樣做,因為用戶呼叫應該能夠跨行執行此操作。我將不勝感激任何想法。謝謝
curl -X POST "localhost:8090/rest/myResource/myEndpoint?user=user01" \
-d 'agg={"comm": {"date_histogram": {"field": "DERIVED_UNIFIED_TIMESTAMP","calendar_interval": "month"}}}&q={ "bool": { "must": [{"terms": {"COMM_TYPE": [ "call","email", "message"] } }]}'
uj5u.com熱心網友回復:
在“&q”(見下文)之前洗掉換行符和空格足以讓 CURL 正常作業。
curl -X POST "localhost:8090/rest/myResource/myEndpoint?user=user01" \
-d 'agg={
"comm": {
"date_histogram": {
"field": "DERIVED_UNIFIED_TIMESTAMP",
"calendar_interval": "month"
}
}
}&q={
"bool": {
"must": [
{
"terms": {
"COMM_TYPE": [
"call",
"email",
"message"
]
}
}
]
}
}'
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/367013.html
標籤:卷曲
