{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/corefx/issues/7864","repository_url":"https://api.github.com/repos/dotnet/corefx","labels_url":"https://api.github.com/repos/dotnet/corefx/issues/7864/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/corefx/issues/7864/comments","events_url":"https://api.github.com/repos/dotnet/corefx/issues/7864/events","html_url":"https://github.com/dotnet/corefx/issues/7864","id":149519258,"number":7864,"title":"Is the Content-Type header produced by StringContent() correct?","user":{"login":"GuardRex","id":1622880,"avatar_url":"https://avatars.githubusercontent.com/u/1622880?v=3","gravatar_id":"","url":"https://api.github.com/users/GuardRex","html_url":"https://github.com/GuardRex","followers_url":"https://api.github.com/users/GuardRex/followers","following_url":"https://api.github.com/users/GuardRex/following{/other_user}","gists_url":"https://api.github.com/users/GuardRex/gists{/gist_id}","starred_url":"https://api.github.com/users/GuardRex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GuardRex/subscriptions","organizations_url":"https://api.github.com/users/GuardRex/orgs","repos_url":"https://api.github.com/users/GuardRex/repos","events_url":"https://api.github.com/users/GuardRex/events{/privacy}","received_events_url":"https://api.github.com/users/GuardRex/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/dotnet/corefx/labels/System.Net","name":"System.Net","color":"d4c5f9"}],"state":"open","locked":false,"assignee":{"login":"davidsh","id":7684835,"avatar_url":"https://avatars.githubusercontent.com/u/7684835?v=3","gravatar_id":"","url":"https://api.github.com/users/davidsh","html_url":"https://github.com/davidsh","followers_url":"https://api.github.com/users/davidsh/followers","following_url":"https://api.github.com/users/davidsh/following{/other_user}","gists_url":"https://api.github.com/users/davidsh/gists{/gist_id}","starred_url":"https://api.github.com/users/davidsh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidsh/subscriptions","organizations_url":"https://api.github.com/users/davidsh/orgs","repos_url":"https://api.github.com/users/davidsh/repos","events_url":"https://api.github.com/users/davidsh/events{/privacy}","received_events_url":"https://api.github.com/users/davidsh/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/dotnet/corefx/milestones/4","html_url":"https://github.com/dotnet/corefx/milestones/1.0.0-rtm","labels_url":"https://api.github.com/repos/dotnet/corefx/milestones/4/labels","id":1248719,"number":4,"title":"1.0.0-rtm","description":"2016 https://github.com/aspnet/Home/wiki/Roadmap","creator":{"login":"joshfree","id":1302850,"avatar_url":"https://avatars.githubusercontent.com/u/1302850?v=3","gravatar_id":"","url":"https://api.github.com/users/joshfree","html_url":"https://github.com/joshfree","followers_url":"https://api.github.com/users/joshfree/followers","following_url":"https://api.github.com/users/joshfree/following{/other_user}","gists_url":"https://api.github.com/users/joshfree/gists{/gist_id}","starred_url":"https://api.github.com/users/joshfree/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joshfree/subscriptions","organizations_url":"https://api.github.com/users/joshfree/orgs","repos_url":"https://api.github.com/users/joshfree/repos","events_url":"https://api.github.com/users/joshfree/events{/privacy}","received_events_url":"https://api.github.com/users/joshfree/received_events","type":"User","site_admin":false},"open_issues":352,"closed_issues":577,"state":"open","created_at":"2015-08-10T18:04:00Z","updated_at":"2016-04-19T20:04:45Z","due_on":"2016-06-30T07:00:00Z","closed_at":null},"comments":9,"created_at":"2016-04-19T16:57:23Z","updated_at":"2016-04-19T20:06:23Z","closed_at":null,"body":"Consider the following code ...\r\n```c#\r\nstring contentType = \"application/atom+xml\";\r\nstring requestPayload = \"some data\";\r\nvar stringContent = new StringContent(requestPayload, Encoding.UTF8, contentType);\r\n```\r\nAccording to Wireshark, I'm seeing a POST using `HttpClient` with this ...\r\n```\r\nContent-Type: application/atom+xml; charset=utf-8\r\n```\r\n![capture](https://cloud.githubusercontent.com/assets/1622880/14647964/a1396782-0625-11e6-9c7a-3cdc1b92e4a2.PNG)\r\n\r\nShouldn't that `Content-Type` value just be ...\r\n```\r\nContent-Type: application/atom+xml\r\n```\r\n?? Confused, because something is choking my Azure Table Storage requests with ...\r\n```\r\nstring stringToSign = \r\n    $\"{requestMethod}\\n\\n{contentType}\\n{dateInRfc1123Format}\\n{canonicalizedResource}\";\r\n```\r\n... and since `SharedKeyLite`, which only requires the date and resource, **works** with my `dateInRfc1123Format` and `canonicalizedResource`, I've sort of narrowed it down to the `contentType` of the request (shown above) not matching what I'm putting into the signature sting, namely just `application/atom+xml`."},"comment":{"url":"https://api.github.com/repos/dotnet/corefx/issues/comments/212104731","html_url":"https://github.com/dotnet/corefx/issues/7864#issuecomment-212104731","issue_url":"https://api.github.com/repos/dotnet/corefx/issues/7864","id":212104731,"user":{"login":"GuardRex","id":1622880,"avatar_url":"https://avatars.githubusercontent.com/u/1622880?v=3","gravatar_id":"","url":"https://api.github.com/users/GuardRex","html_url":"https://github.com/GuardRex","followers_url":"https://api.github.com/users/GuardRex/followers","following_url":"https://api.github.com/users/GuardRex/following{/other_user}","gists_url":"https://api.github.com/users/GuardRex/gists{/gist_id}","starred_url":"https://api.github.com/users/GuardRex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GuardRex/subscriptions","organizations_url":"https://api.github.com/users/GuardRex/orgs","repos_url":"https://api.github.com/users/GuardRex/repos","events_url":"https://api.github.com/users/GuardRex/events{/privacy}","received_events_url":"https://api.github.com/users/GuardRex/received_events","type":"User","site_admin":false},"created_at":"2016-04-19T20:06:23Z","updated_at":"2016-04-19T20:06:23Z","body":"My concern about it remains: If the dev sets a value explicitly on `new StringContent()`, they will not be aware that `charset` is being added.\r\n\r\nIn any case where the header is part of a service-generated hash that will be checked against a supplied signature (without the `charset`, since the dev didn't know it was added to the request header), as is the case with Azure Storage REST Service, ... :boom: ... and lost time having to check a lot of little things partially because the Azure REST docs and exception messages are so poor. All the service comes back with is 'your auth header is hosed! ... check the signature.'\r\n\r\nIf the dev sets an explicit value, seems like it should be honored. At least mod the description to note that `charset` will be added automatically. It's possible that if I saw that pop-up in VS when I was laying down the code, it might have triggered more immediate interest in trying `MediaTypeHeaderValue()`."}}