How to simulate http request using WatiN with specific HTTP referrer and query string?

后端 未结 2 1294
孤街浪徒
孤街浪徒 2021-01-17 00:34

When I use WatiN to go to a specific web page, how can I fake the HTTP referrer with a query string (i.e. request is from google search wit

2条回答
  •  北海茫月
    2021-01-17 01:17

    I might be missing the point of what you're trying to do, but I don't think WatiN is capable of fakingbthe referrer.

    WatiN drives real browsers, so it isn't in the job of faking stuff. If you want a page to have a specific referrer then you need to have it linked from that referrer.

    As you suggest, Fiddler is much better suited for this sort of thing. If you want you can modify requests on the fly using custom rules so that the referrer is whatever you like. You don't need to use Fiddlercore for this. Running Fiddler as a client proxy, or on you server as a reverse proxy might be enough.

提交回复
热议问题