So I want to modify a standard Http 200 response from a server, which contains headers and an image in the responsebody. I want to selectively replace that image (ideally from a stored image file; but the actual image will change over time and/or I want to select different images based on logic). I want to retain the original headers from the server response, and replace the responsebody image. I would use the OnBeforeResponse event to trap the response. The images are standard files (image file only, no http headers).
I see I can load an entire response from a file with FildderScript, but I can't see how to load just the responsebody from a file (binary image jpg/or png or gif). I thought possibly I could populate an array from the image file, and then use ResponseBody:System.Byte[] call to attach the image (and fix up the headers associated with the size/content type etc).
I have searched far and wide but haven't found any related example FiddlerScript for this operation. Could you post a snippet along these lines?
I see I can load an entire response from a file with FildderScript, but I can't see how to load just the responsebody from a file (binary image jpg/or png or gif). I thought possibly I could populate an array from the image file, and then use ResponseBody:System.Byte[] call to attach the image (and fix up the headers associated with the size/content type etc).
I have searched far and wide but haven't found any related example FiddlerScript for this operation. Could you post a snippet along these lines?