How to send a header using a HTTP request through a curl call?

后端 未结 10 1404
梦如初夏
梦如初夏 2020-11-22 16:45

I wish to send a header to my Apache server on a Linux box. How can I achieve this via a curl call?

10条回答
  •  野性不改
    2020-11-22 17:22

    GET (multiple parameters):

    curl -X  GET "http://localhost:3000/action?result1=gh&result2=ghk"
    

    or

    curl --request  GET "http://localhost:3000/action?result1=gh&result2=ghk"
    

    or

    curl  "http://localhost:3000/action?result1=gh&result2=ghk"
    

    or

    curl -i -H "Application/json" -H "Content-type: application/json"  "http://localhost:3000/action?result1=gh&result2=ghk"
    

提交回复
热议问题