This curl recipe shows you how to add a referrer to a curl request. Web servers often check the referrer before allowing the request, so you better know how to set it. To set a referrer use the -e '' argument.

Add a Referrer

curl -e ''

This recipe uses the -e argument sets the HTTP referrer to and makes a GET request to When the owner of will look in his access.log files, he'll think that someone came from Google while searching for cats, but in reality, we'll have bamboozled the owner

Send an Empty Referrer

curl -e ''

This recipe also uses the -e option to set the referer but it leaves the argument empty '' (set to nothing). This clears the value part of Referer: HTTP header and curl send an empty HTTP referer.

Send a Referer via the -H argument

curl -H 'Referer:'

This recipe is for pros only. Normally, you'd send the referrer via -e (as illustrated in the previous recipes) but you can also send it via the -H 'Referer: URL' argument that sets the full HTTP header. In this recipe, the HTTP header is set to Referer: so the web server at will think the request came from this address.

Created by Browserling

These curl recipes were written down by me and my team at Browserling. We use recipes like this every day to get things done and improve our product. Browserling itself is an online cross-browser testing service powered by alien technology. Check it out!

Secret message: If you love my curl recipe, then I love you, too! Use coupon code CURLLING to get a discount at my company.