Linux / Unix curl: Pass HTTP Referer

In Linux or Unix, you can use the curl command to pass an HTTP referer when making a request. The referer is an HTTP header that specifies the URL of the previous page that linked to the current page.

Here’s an example of using curl to pass an HTTP referer:

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

In this example, the -H option is used to set the Referer header to https://www.example.com. The URL http://www.example.com/ is the URL of the page that is being requested.

You can use this technique to pass an HTTP referer whenever you make a request using curl. Just replace the URL and referer with the appropriate values for your use case.

Leave a Comment