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

Can't change the response "for real".

1 Answer 14 Views
Windows
This is a migrated thread and some comments may be shown as answers.
Xuan
Top achievements
Rank 1
Xuan asked on 08 Feb 2015, 10:42 AM
if ( (oSession.host=="203.104.209.55") && (oSession.PathAndQuery.indexOf("/kcsapi/api_port/port")>-1) ){
        oSession["ui-bold"]="true";
        oSession["x-breakresponse"]="true";
        oSession.utilSetResponseBody("");
}

Above is what is have in OnBeforeResponse function.

However when I request this url,
1. the session won't be paused
2. although it shows in fiddler inspection that the response body is blank, I can still view the response body in my browser
3. the ui-bold works :(

If I enable the automatic breakpoint (alt+F11), and then continue the process. Both fiddler and my browser shows no response now.


1 Answer, 1 is accepted

Sort by
0
Eric Lawrence
Telerik team
answered on 09 Feb 2015, 04:03 PM
You have enabled streaming for this session in Fiddler (e.g. the STREAM button is depressed on Fiddler's toolbar, or it's a audio/video response and you have streaming enabled for those).

You need to move your code to either OnBeforeRequest or OnPeekAtResponseHeaders and remove the line where you try to set the response body, or you need to configure bBufferResponse=true on this session in one of those two earlier handlers.

Regards,
Eric Lawrence
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Windows
Asked by
Xuan
Top achievements
Rank 1
Answers by
Eric Lawrence
Telerik team
Share this question
or