1

I'm using Fiddler4 (not sure if that is relevant). I'm trying to add a feature that lets me resend requests a certain number of times with a delay between each request. Everything seems to be fine but I can't seem to convert oSession.oRequest into a string, or in other words, get the HTTP request string (headers and body) from Fiddler's provided session object. Documentation has been unhelpful.

Kevin Lu
  • 303
  • 1
  • 4
  • 13

1 Answers1

1

To get the HTTP request header use oSession.RequestHeaders.ToString().

To get the request body you can use oSession.GetRequestBodyAsString().

Amnon Shochot
  • 8,998
  • 4
  • 24
  • 30
  • Thanks. I tried that and added "\r\n" between the two and it worked! – Kevin Lu May 08 '15 at 00:50
  • While this answer is literally correct, the question itself is arguably buggy. You should not assume that all requests can be safely be converted into strings; any binary data will be corrupted. Furthermore, if you call GetRequestBodyAsString, this will remove all chunking/compression, such that the string body will no longer be compatible with the headers that you've grabbed. Instead, the proper way to achieve this is to avoid converting to a string to start with... – EricLaw May 14 '15 at 20:07