{"action":"created","issue":{"url":"https://api.github.com/repos/nutzam/nutz/issues/1078","repository_url":"https://api.github.com/repos/nutzam/nutz","labels_url":"https://api.github.com/repos/nutzam/nutz/issues/1078/labels{/name}","comments_url":"https://api.github.com/repos/nutzam/nutz/issues/1078/comments","events_url":"https://api.github.com/repos/nutzam/nutz/issues/1078/events","html_url":"https://github.com/nutzam/nutz/issues/1078","id":163593966,"number":1078,"title":"ContentType 编码格式可自定义","user":{"login":"Wizzercn","id":2408114,"avatar_url":"https://avatars.githubusercontent.com/u/2408114?v=3","gravatar_id":"","url":"https://api.github.com/users/Wizzercn","html_url":"https://github.com/Wizzercn","followers_url":"https://api.github.com/users/Wizzercn/followers","following_url":"https://api.github.com/users/Wizzercn/following{/other_user}","gists_url":"https://api.github.com/users/Wizzercn/gists{/gist_id}","starred_url":"https://api.github.com/users/Wizzercn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wizzercn/subscriptions","organizations_url":"https://api.github.com/users/Wizzercn/orgs","repos_url":"https://api.github.com/users/Wizzercn/repos","events_url":"https://api.github.com/users/Wizzercn/events{/privacy}","received_events_url":"https://api.github.com/users/Wizzercn/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-07-04T02:37:18Z","updated_at":"2016-08-19T10:47:36Z","closed_at":null,"body":"比如SpringMVC 可以自定义不同类型的编码格式：\r\n```\r\n\r\n<!--1、检查扩展名（如my.pdf）；2、检查Parameter（如my?format=pdf）；3、检查Accept Header -->\r\n\t<bean id=\"contentNegotiationManager\"\r\n\t\tclass=\"org.springframework.web.accept.ContentNegotiationManagerFactoryBean\">\r\n\t\t<!-- 扩展名至mimeType的映射,即 /user.json => application/json -->\r\n\t\t<property name=\"favorPathExtension\" value=\"true\" />\r\n\t\t<!-- 用于开启 /userinfo/123?format=json 的支持 -->\r\n\t\t<property name=\"favorParameter\" value=\"true\" />\r\n\t\t<property name=\"parameterName\" value=\"format\" />\r\n\t\t<!-- 是否忽略Accept Header -->\r\n\t\t<property name=\"ignoreAcceptHeader\" value=\"false\" />\r\n\t\t<property name=\"mediaTypes\"> <!--扩展名到MIME的映射；favorPathExtension, favorParameter是true时起作用 -->\r\n\t\t\t<value>\r\n\t\t\t\tjson=application/json;charset=utf-8\r\n\t\t\t\txml=application/xml;charset=utf-8\r\n\t\t\t\thtml=text/html;charset=utf-8\r\n\t\t\t</value>\r\n\t\t</property>\r\n\t\t<!-- 默认的content type -->\r\n\t\t<property name=\"defaultContentType\" value=\"text/html\" />\r\n\t</bean>\r\n```\r\n\r\n使用NutzWx 还要配置环境变量支持 UTF8 不太方便啊，而且不配还报错，希望框架提供配置功能，那么就不受环境变量限制了、方便控制。"},"comment":{"url":"https://api.github.com/repos/nutzam/nutz/issues/comments/240987469","html_url":"https://github.com/nutzam/nutz/issues/1078#issuecomment-240987469","issue_url":"https://api.github.com/repos/nutzam/nutz/issues/1078","id":240987469,"user":{"login":"Wizzercn","id":2408114,"avatar_url":"https://avatars.githubusercontent.com/u/2408114?v=3","gravatar_id":"","url":"https://api.github.com/users/Wizzercn","html_url":"https://github.com/Wizzercn","followers_url":"https://api.github.com/users/Wizzercn/followers","following_url":"https://api.github.com/users/Wizzercn/following{/other_user}","gists_url":"https://api.github.com/users/Wizzercn/gists{/gist_id}","starred_url":"https://api.github.com/users/Wizzercn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wizzercn/subscriptions","organizations_url":"https://api.github.com/users/Wizzercn/orgs","repos_url":"https://api.github.com/users/Wizzercn/repos","events_url":"https://api.github.com/users/Wizzercn/events{/privacy}","received_events_url":"https://api.github.com/users/Wizzercn/received_events","type":"User","site_admin":false},"created_at":"2016-08-19T10:47:36Z","updated_at":"2016-08-19T10:47:36Z","body":"@wendal 你懂得..."}}
{"actor":{"display_login":"Wizzercn"}}