This is a migrated thread and some comments may be shown as answers.

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

1 Answer 329 Views
Fiddler Classic
This is a migrated thread and some comments may be shown as answers.
Hotdog
Top achievements
Rank 1
Hotdog asked on 30 Sep 2015, 07:45 AM

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.

1 Answer, 1 is accepted

Sort by
0
Accepted
Eric Lawrence
Telerik team
answered on 30 Sep 2015, 04:38 PM
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
Tags
Fiddler Classic
Asked by
Hotdog
Top achievements
Rank 1
Answers by
Eric Lawrence
Telerik team
Share this question
or