locked
Capturing the Request itself RRS feed

  • Question

  • User-1647864282 posted

    Hi

    Is there a way to capture a WebRequest and store it (serialized etc) and somehow recreate the same request at a later time and send it back to the server?

    I know I can use the WebRequest.Create(uri) to make a simple request (like www.google.com) but I am looking for storing the complete POST or GET whatever the case might be. Would appreciate your help!

    Thanks.

    Monday, August 3, 2009 2:23 PM

Answers

  • User863160722 posted

    You can use the SaveAs method of the HttpRequest class to save the complete request details to a text file. However, I'm not aware of any built-in method which could load this file and re-issue the request. You could do it manually using a tool like Fiddler; otherwise, you'd have to write code to parse the file and build an HttpWebRequest from it.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, August 3, 2009 3:37 PM
  • User-25924017 posted

    Look at this article on MSDN: 

    http://msdn.microsoft.com/en-us/library/debx8sh9.aspx

    Its shows create and saving a request, posting it to get response.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, August 3, 2009 3:39 PM

All replies

  • User863160722 posted

    You can use the SaveAs method of the HttpRequest class to save the complete request details to a text file. However, I'm not aware of any built-in method which could load this file and re-issue the request. You could do it manually using a tool like Fiddler; otherwise, you'd have to write code to parse the file and build an HttpWebRequest from it.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, August 3, 2009 3:37 PM
  • User-25924017 posted

    Look at this article on MSDN: 

    http://msdn.microsoft.com/en-us/library/debx8sh9.aspx

    Its shows create and saving a request, posting it to get response.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, August 3, 2009 3:39 PM
  • User-1647864282 posted

    Thank you very much for replying. I think that is what I was looking for :)

    Monday, August 3, 2009 6:11 PM