c# - Response.Write removes parenthesis ')' -


i working angular jsonp.

i generate reponse on server:

httpcontext.current.response.write(string.format("{0}({1})", httpcontext.current.request.querystring["callback"], json)); 

which writes string:

angular.callbacks._b({"currency":"usd","balance":1000,"bonus":100,"openpositions":[]}) 

in chrome devtool inspect response , follows:

angular.callbacks._b({"currency":"usd","balance":1000,"bonus":100,"openpositions":[]} 

pay attention missing closing parathesis @ end of response.

what's wierd works objects 1 property: object serialize json:

 new { token: "somestring"}  angular.callbacks._a({"token":"somestring"}) 

flush output - httpcontext.current.response.flush(). seems output not being sent client due reasons.


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -