Skip to content

Instantly share code, notes, and snippets.

@jazlopez
Created January 8, 2023 08:10
Show Gist options
  • Select an option

  • Save jazlopez/4da5624f5237e9caa6d2361ec79fc973 to your computer and use it in GitHub Desktop.

Select an option

Save jazlopez/4da5624f5237e9caa6d2361ec79fc973 to your computer and use it in GitHub Desktop.
.curlrc simple practical configuration
# ---------------------------------------------
# Custom Configurations for CURL
# Usage instructions:
# Download this file and save it at: $HOME/.curlrc
# Contact: Jaziel Lopez Software Engineer Tijuana Area, BC MX
# 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"
# HTTP Compresed
--compressed
#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"
# follow redirects
--location
#verbose
--verbose
#trace the time taken. more info here https://everything.curl.dev/usingcurl/verbose/trace
# --trace-time
# write the trace data to stdout
# --trace-ascii -
# ok if certification validation fails
--insecure
# authentication
-u user:password
# output
-w "Content Type:%{content_type}\nResponse Code: %{response_code}\nSpeed Download: %{speed_download}\n"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment