java - HttpServletResponse redirect with application/json as Content-Type -


i'm trying redirect post request json host using following code. when tested out, got error "unsupported media type" , browser indicated content type of redirected request "text/html".

does have idea how correctly set content type of redirected request? in advance.

@override protected void dopost(httpservletrequest req, httpservletresponse resp) throws servletexception, ioexception {     string targeturl = "http://localhost:8080/getjson";     resp.setstatus(httpservletresponse.sc_temporary_redirect);     resp.setcontenttype("application/json");     resp.setheader("location", targeturl); } 


Comments

Popular posts from this blog

jquery - How do you format the date used in the popover widget title of FullCalendar? -

Bubble Sort Manually a Linked List in Java -

asp.net mvc - SSO between MVCForum and Umbraco7 -