How do i remove the header in the curl request
I am using curl API for secured SSL connection. My command line request to the server through curl in linux machine:
curl -k https://<ip>:<port> -H "User-agent:" -H "Host:" -H "Accept:" -X <request> -o ssl.txt
Myrequest i开发者_StackOverflows going like this
GET /005F02007024058020C0100416476173900101001000000000000000010000000210120021001200344761739001010010D10122011138780893132333435363738313132323333343435353636373738C2115B54A8F08C150006303030303031 HTTP/1.1
How do i remove this GET and HTTP/1.1 through command prompt? Please suggest me the Curl API to remopve this HTTP/1.1
You should try to set CURLOPT_HEADER to 0.
If you set the CURLOPT_HEADER to 1, you will tell libcurl to get information about the target file and output "headers" about it. The headers will be in "HTTP-style", looking like they do in HTTP.
If you remove the GET and HTTP/1.1, then it's no longer an HTTP transaction. The fact that you're using -X leads me to believe that you're trying to do something HTTP-like, but not quite HTTP, and curl can't help you there.
精彩评论