cURL for Windows: how can I send multiple line command in a console?

前端 未结 3 1510
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-30 05:19

I am learning to use cURL and I need to run this in a console:

curl -XGET localhost:9200/library/book/_search?pretty=true -d {
    \"query\" : {
        \"qu         


        
3条回答
  •  孤独总比滥情好
    2020-12-30 06:01

    I didn't find any way so far to send command spanning multiple using curl on windows. However, I was able to find a way to get the task done. Below is how I would rewrite the command you are trying to achieve

    curl -XGET localhost:9200/library/book/_search?pretty=true -d "{ \"query\" : { \"query_string\" : { \"query\" : \"title:crime\" }  } }"
    

    Just make sure the /library/book/ is right index name.

    Hoping to hear back if you are able to make it

提交回复
热议问题