Skip to content

Instantly share code, notes, and snippets.

@v1m

v1m/.curlrc

Created Nov 3, 2015
Embed
What would you like to do?
sample .curlrc file
#this is a sample .curlrc file
# store the trace in curl_trace.txt file. beware that multiple executions of the curl command will overwrite this file
--trace curl_trace.txt
# store the header info in curl_headers.txt file. beware that multiple executions of the curl command will overwrite this file
--dump-header curl_headers.txt
#change the below referrer URL or comment it out entirely
-e "https://www.google.com"
#change the below useragent string. get your/other UA strings from http://www.useragentstring.com/
-A "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/525.13 (KHTML, like Gecko) Chrome/0.2.149.27 Safari/525.13"
#some headers
-H "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8"
-H "Upgrade-Insecure-Requests: 1"
-H "Accept-Encoding: gzip, deflate, sdch"
-H "Accept-Language: en-US,en;q=0.8"
@gerchicov-bp

This comment has been minimized.

Copy link

@gerchicov-bp gerchicov-bp commented Jan 16, 2018

@v1m what does this file actually do?
In my case I had it with option "insecure" and it caused this error:
https://stackoverflow.com/questions/38761716/error-installing-crashlytics-ssl-peer-handshake-failed

@kvakhil95

This comment has been minimized.

Copy link

@kvakhil95 kvakhil95 commented Nov 13, 2018

I want to add the -k or --insecure header. How do I proceed?

@harryge00

This comment has been minimized.

Copy link

@harryge00 harryge00 commented Dec 3, 2018

@kvakhil95 Just add -k to .curlrc

@markhu

This comment has been minimized.

Copy link

@markhu markhu commented Apr 27, 2021

There is an alternate syntax for some parameters, for instance user-agent="curl-QA" is equivalent to -A "curl-QA"

P.S. The --header "key:val" # must be in double-quotes --single-quotes don't work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment