Syntax error when find and replace - need to escape characters?

2 posts, 1 answers
  1. Hotdog
    Hotdog avatar
    1 posts
    Member since:
    Sep 2015

    Posted 30 Sep 2015 Link to this post

    I'm working with an HTTP page and trying to replace and automatically pass to the website any instances of;

    "service":"refresh"}​

    with

    "service":"set_score","status":1,"score":100,"data":{}}

    using built-in rules (I think OnBeforeResponse is a proper place for this). I've tried to reference this post by E.L.; https://groups.google.com/d/msg/httpfiddler/ojIWanufbjo/nA1WWlaKgnoJ , but I can't seem to get it to work - my script editor doesn't like what I'm feeding it. I've been toying with this for a couple of days and while the editor isn't that scary at all, I'm not that familiar with .NET to know what I'm doing wrong.

  2. Answer
    Eric Lawrence
    Admin
    Eric Lawrence avatar
    833 posts

    Posted 30 Sep 2015 Link to this post

    Hi, Hotdog--

    Sharing the code you've tried thus far would be helpful. It would also be helpful to explain where the text in question appears-- is it in a POST request body, a script or HTML response, or somewhere else?

    FiddlerScript is written in JScript.NET, a dialect of JavaScript. As a consequence, you can either use ' to delimit strings, or you can use " and escape any " characters within by using a leading \ character.

    Regards,
    Eric Lawrence
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top