You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2016/05/12 09:24:19 UTC
[Bug 59517] New: [Help] About Header 'Content-type'
https://bz.apache.org/bugzilla/show_bug.cgi?id=59517
Bug ID: 59517
Summary: [Help] About Header 'Content-type'
Product: Tomcat 8
Version: 8.0.33
Hardware: PC
Status: NEW
Severity: enhancement
Priority: P2
Component: Catalina
Assignee: dev@tomcat.apache.org
Reporter: liuqiangqiang@huawei.com
Created attachment 33840
--> https://bz.apache.org/bugzilla/attachment.cgi?id=33840&action=edit
Response code
I use tomcat as restful server.
I call a rest api and respone like this:
"servletRespone.addHeader("Content-type", "application/json; charset=UTF-8");"
I wish to obtain the "Content-type" is
"application/json; charset=UTF-8",
but in fact I obtain "Content-type" is
"application/json;charset=UTF-8".
Charset between json and less of a space.
I read the tomcat source and find this:
public String getContentType() {
String ret = contentType;
if (ret != null
&& characterEncoding != null
&& charsetSet) {
ret = ret + ";charset=" + characterEncoding;
}
return ret;
}
Can you help me?
How do I get to be able to like "application/json; charset=UTF-8".
best regards
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
[Bug 59517] [Help] About Header 'Content-type'
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=59517
--- Comment #2 from liuqiangqiang <li...@huawei.com> ---
ok,thank you
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
[Bug 59517] [Help] About Header 'Content-type'
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=59517
Mark Thomas <ma...@apache.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |INVALID
OS| |All
--- Comment #1 from Mark Thomas <ma...@apache.org> ---
Bugzilla is not a support forum. Please use the Tomcat users' mailing list.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org