Wednesday 15 September 2010

javascript - Forcing an HTTP request to fail in browser -



javascript - Forcing an HTTP request to fail in browser -

is possible create http request has been sent server browser fail without having alter javascript?

i have post request website sending server , trying test how our code reacts when request fails (e.g. http 500 response). unfortunately, environment need test in has uglified , compressed javascript, inserting breakpoint or altering javascript isn't option. there way utilize browser simulate failed request?

the request takes long time complete, using browser's console run javascript command possibility.

i have tried using window.stop(), however, not work since need failure code execute.

i aware of alternative of setting proxy server, avoid possible.

chrome's dev tools have alternative "beautify" (i.e. re-indent) minified javascript (press "{}" button @ bottom left). can combined "xhr breakpoint" alternative break when request made. xhr breakpoints don't back upwards modifying response though afaik, should able find way via code.

javascript google-chrome http firefox httprequest

No comments:

Post a Comment