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
Post a Comment