Search code examples
haskellscotty

Retrieve the HTTP referrer URL using Scotty


$_SERVER[HTTP_REFERER] allows one to retrieve the referring URL in PHP, how to do the same in Haskell?


Solution

  • The http_referer is stored in the HTTP header, which means that you can retrieve it using the header function of scotty like this:

    url <- header "referer"