Created
February 27, 2018 13:07
-
-
Save dstd/39927fc79c065c8d6229070870a2ebe9 to your computer and use it in GitHub Desktop.
[Fiddler] JSON response modification
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ... | |
static function OnBeforeResponse(oSession: Session) { | |
// ... | |
if (oSession.uriContains("/someMethod")) { | |
var json = Fiddler.WebFormats.JSON.JsonDecode(oSession.GetResponseBodyAsString()).JSONObject; | |
var p = json["field"]["subfield"]["subsubfield"]; | |
p["field1"] = 0 != 1; | |
p["anotherfield2"] = 0 != 0; | |
p["yaf3"] = 0 != 1; | |
oSession.utilSetResponseBody(Fiddler.WebFormats.JSON.JsonEncode(json)); | |
} | |
// ... | |
} | |
// ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment