Forum Discussion
hooleylist
May 27, 2011Cirrostratus
Hi Jim,
You can insert a cookie using HTTP::cookie insert and a header using HTTP::header insert in the HTTP_REQUEST event:
http://devcentral.f5.com/wiki/default.aspx/iRules/http__cookie
http://devcentral.f5.com/wiki/default.aspx/iRules/http__header
You can get the requested host using [HTTP::host] and the URI using [HTTP::uri]. If you're inserting something in a cookie, you should consider URI (percent) encoding it:
http://devcentral.f5.com/wiki/default.aspx/iRules/http__host
http://devcentral.f5.com/wiki/default.aspx/iRules/http__uri
http://devcentral.f5.com/wiki/default.aspx/iRules/uri__encode
If you get stuck, let us know what you've tried and what issue(s) you're seeing. If you have an anonymized example of the original request headers you expect from the client and what you'd like the modified request to look like, we could give you a more exact example iRule.
Aaron