{"action":"created","issue":{"url":"https://api.github.com/repos/manyminds/api2go/issues/217","labels_url":"https://api.github.com/repos/manyminds/api2go/issues/217/labels{/name}","comments_url":"https://api.github.com/repos/manyminds/api2go/issues/217/comments","events_url":"https://api.github.com/repos/manyminds/api2go/issues/217/events","html_url":"https://github.com/manyminds/api2go/issues/217","id":115938183,"number":217,"title":"Is there a way to include charset=utf-8 at the end of a Response header","user":{"login":"abrykajlo","id":1366204,"avatar_url":"https://avatars.githubusercontent.com/u/1366204?v=3","gravatar_id":"","url":"https://api.github.com/users/abrykajlo","html_url":"https://github.com/abrykajlo","followers_url":"https://api.github.com/users/abrykajlo/followers","following_url":"https://api.github.com/users/abrykajlo/following{/other_user}","gists_url":"https://api.github.com/users/abrykajlo/gists{/gist_id}","starred_url":"https://api.github.com/users/abrykajlo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abrykajlo/subscriptions","organizations_url":"https://api.github.com/users/abrykajlo/orgs","repos_url":"https://api.github.com/users/abrykajlo/repos","events_url":"https://api.github.com/users/abrykajlo/events{/privacy}","received_events_url":"https://api.github.com/users/abrykajlo/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/manyminds/api2go/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-11-09T18:39:44Z","updated_at":"2015-12-04T16:52:44Z","closed_at":null,"body":"We are using utf-8 in our database and require that our reponse headers contain content-type as such:\r\n\r\n```\r\n\"Content-Type\": \"application/vnd.api+json; charset=utf-8\"\r\n```\r\n\r\n#119 looked like it may have fixed this. By adding your own marshalers you can include\r\n\r\n```\r\nvar marshalers = map[string]ContentMarshaler {\r\n    \"application/vnd.api+json; charset=utf-8\": JSONContentMarshaler{},\r\n}\r\n```\r\n\r\nThis should in theory be used after `httputils.NegotiateContentType` gets executed here: https://github.com/manyminds/api2go/blob/7e85e66ad917fb1269891367fa712207fd06f33e/api.go#L1130\r\n\r\nIn fact what happens inside that function here: https://github.com/golang/gddo/blob/master/httputil/negotiate.go#L47\r\n\r\n [ParseAccept](https://github.com/golang/gddo/blob/master/httputil/header/header.go#L171) will filter out any header which contains any extensions which seemed to be the reason for #119 any extensions will be filtered and will always use the defaultContentTypHeader which is \"application/vnd.api+json\""},"comment":{"url":"https://api.github.com/repos/manyminds/api2go/issues/comments/162019099","html_url":"https://github.com/manyminds/api2go/issues/217#issuecomment-162019099","issue_url":"https://api.github.com/repos/manyminds/api2go/issues/217","id":162019099,"user":{"login":"interlock","id":118081,"avatar_url":"https://avatars.githubusercontent.com/u/118081?v=3","gravatar_id":"","url":"https://api.github.com/users/interlock","html_url":"https://github.com/interlock","followers_url":"https://api.github.com/users/interlock/followers","following_url":"https://api.github.com/users/interlock/following{/other_user}","gists_url":"https://api.github.com/users/interlock/gists{/gist_id}","starred_url":"https://api.github.com/users/interlock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/interlock/subscriptions","organizations_url":"https://api.github.com/users/interlock/orgs","repos_url":"https://api.github.com/users/interlock/repos","events_url":"https://api.github.com/users/interlock/events{/privacy}","received_events_url":"https://api.github.com/users/interlock/received_events","type":"User","site_admin":false},"created_at":"2015-12-04T16:52:44Z","updated_at":"2015-12-04T16:52:44Z","body":"The middleware handling I added with #152 makes this kinda painful to override as well. I don't suppose in this refactor we could slide the middleware handling closer to a chained handler? I know @kevpie had some thoughts on that. AKA, he didn't like my easy mode middlewares ;-)"}}