How can I set a cookie in a request using Fiddler?

后端 未结 7 485
深忆病人
深忆病人 2020-12-29 01:06

I need to set a cookie before I issue a request to a Web site using Fiddler. How do I do this?

7条回答
  •  囚心锁ツ
    2020-12-29 01:38

    This solution is valid for Cookie based authentication:

    If you want to test the API/url which have authentication enabled, please try following, i am showing for MVC web API on IIS server. usually there are more than 1 cookie responsible for authorization, so you may need to send more than 1 cookie in header as follows:

    User-Agent: Fiddler Host: localhost:51000 content-Type: application/json Cookie : .ASPXAUTH=xxxxx;ASP.NET_SessionId=yyyy;__RequestVerificationToken=zzzz
    

提交回复
热议问题