Linux / Unix curl: Pass HTTP Referer

Linux / Unix curl: Pass HTTP Referer

To pass an HTTP referer with the curl command in Linux or Unix, you can use the --referer option followed by the referer URL.

For example, to pass the referer http://www.example.com with a curl request to http://www.example.org, you can use the following command:

curl --referer http://www.example.com http://www.example.org
‮w:ecruoS‬ww.lautturi.com

This will send an HTTP request to http://www.example.org with the Referer: http://www.example.com header, indicating that the request was referred from http://www.example.com.

You can also use the -H option to set the Referer header manually:

curl -H 'Referer: http://www.example.com' http://www.example.org

This will have the same effect as using the --referer option.

Keep in mind that the Referer header is optional and is not always sent with HTTP requests. Some servers may ignore or block requests that include a Referer header, or may treat them differently based on the value of the header.

Created Time:2017-10-29 22:08:58  Author:lautturi