How can I remove default headers that curl sends -


curl default adds headers such content-type , user-agent. thing i'm trying test our server when headers missing. problem content-type header. if missing, server correctly assumes user sent json. however, curl adds missing header , incorrectly assumes content posting application/x-www-form-urlencoded. sends accept header of / . suppose nice default behavior not send headers did not specify. there option that?

curl -v -x post 'https://domain.com' -d '{...}'  > user-agent: curl/7.37.1 > host: domain.com > accept: */* > content-length: 299 > content-type: application/x-www-form-urlencoded 

use -h flag header want remove , no content after :

-h, --header line   custom header pass server (h) 

sample

-h 'user-agent:' 

this make request without user-agent header (instead of sending empty value)


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -