3

I am using Visual Studio 2010 Ultimate to perform web and load tests. I have a set of web tests that call REST web services that require OAuth credentials and I'm looking for information on how I can access the associated Http Headers and Post body the request. I've created a web test plugin that acts as an Authorization Manager and have overriden the PreWebTest method. When I look at the PreWebTestEventArgs argument, I see the WebTest and its WebTestContext but I don't see any obvious way to access the actual Http Headers or the Post Body where I might be able to insert the OAuth components. Has anyone been able to affect the Http Request with the associated web test? Any insight will be much appreciated. Thanks.

Joel Coehoorn
  • 399,467
  • 113
  • 570
  • 794

1 Answers1

1

I think you'll need to override PreRequest instead of PreWebTest.

PreRequestEventArgs has the Request property which is the WebTestRequest object that has access to the headers and post body.

agentnega
  • 3,478
  • 1
  • 25
  • 31