{"action":"created","issue":{"url":"https://api.github.com/repos/aspnet/Mvc/issues/4257","repository_url":"https://api.github.com/repos/aspnet/Mvc","labels_url":"https://api.github.com/repos/aspnet/Mvc/issues/4257/labels{/name}","comments_url":"https://api.github.com/repos/aspnet/Mvc/issues/4257/comments","events_url":"https://api.github.com/repos/aspnet/Mvc/issues/4257/events","html_url":"https://github.com/aspnet/Mvc/issues/4257","id":139545955,"number":4257,"title":"JsonResult returning partial data to HttpClient","user":{"login":"bragma","id":1101058,"avatar_url":"https://avatars.githubusercontent.com/u/1101058?v=3","gravatar_id":"","url":"https://api.github.com/users/bragma","html_url":"https://github.com/bragma","followers_url":"https://api.github.com/users/bragma/followers","following_url":"https://api.github.com/users/bragma/following{/other_user}","gists_url":"https://api.github.com/users/bragma/gists{/gist_id}","starred_url":"https://api.github.com/users/bragma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bragma/subscriptions","organizations_url":"https://api.github.com/users/bragma/orgs","repos_url":"https://api.github.com/users/bragma/repos","events_url":"https://api.github.com/users/bragma/events{/privacy}","received_events_url":"https://api.github.com/users/bragma/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/aspnet/Mvc/labels/2%20-%20Working","name":"2 - Working","color":"CCCCCC"},{"url":"https://api.github.com/repos/aspnet/Mvc/labels/investigate","name":"investigate","color":"bfe5bf"}],"state":"open","locked":false,"assignee":{"login":"javiercn","id":6995051,"avatar_url":"https://avatars.githubusercontent.com/u/6995051?v=3","gravatar_id":"","url":"https://api.github.com/users/javiercn","html_url":"https://github.com/javiercn","followers_url":"https://api.github.com/users/javiercn/followers","following_url":"https://api.github.com/users/javiercn/following{/other_user}","gists_url":"https://api.github.com/users/javiercn/gists{/gist_id}","starred_url":"https://api.github.com/users/javiercn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/javiercn/subscriptions","organizations_url":"https://api.github.com/users/javiercn/orgs","repos_url":"https://api.github.com/users/javiercn/repos","events_url":"https://api.github.com/users/javiercn/events{/privacy}","received_events_url":"https://api.github.com/users/javiercn/received_events","type":"User","site_admin":false},"milestone":null,"comments":5,"created_at":"2016-03-09T11:06:18Z","updated_at":"2016-04-15T19:37:08Z","closed_at":null,"body":"Hi,\r\nI'm trying to understand a problem with a simple controller returning an IEnumerable and getting the result with HttpClient. I get a well formed Json response, but it contains only a part of the collection. If I materialize the collection with a \".ToList\", then the entire content is returned.\r\n\r\nThis is the controller:\r\n```[HttpGet(\"testarray\")]\r\npublic IActionResult TestArray()\r\n{\r\n\treturn Json(Enumerable.Range(1, 1000).Select(n => \"0123456789\"));\r\n}\r\n```\r\n\r\nAnd this is the test code:\r\n```\r\n[Fact]\r\npublic async Task GetTestArray()\r\n{\r\n\tvar getResponse = await _testClient.GetAsync(\"/api/tests/testarray\");\r\n\tvar fetchedData = await getResponse.Content.ReadAsStringAsync();\r\n\tvar results = JsonConvert.DeserializeObject<IEnumerable<string>>(fetchedData);\r\n\tAssert.Equal(1000, fetchedData.Count());\r\n}\r\n```\r\n\r\nThe test fails because it receives only 79 results instead of 1000. Notice that the \"fetchedData\" string is well formed (i.e. not truncated) and a valid Json array, but with only 79 elements in.\r\n\r\nBut if on the controller I materialize the list, the controller returns all data:\r\n```\r\n[HttpGet(\"testarray\")]\r\npublic IActionResult TestArray()\r\n{\r\n\treturn Json(Enumerable.Range(1, 1000).Select(n => \"0123456789\").ToList());\r\n}\r\n```\r\n\r\nThe only clue I have is that the response is always more or less 1000 bytes. If as an example I reduce the size of the array elements, more elements are returned.\r\n"},"comment":{"url":"https://api.github.com/repos/aspnet/Mvc/issues/comments/210610663","html_url":"https://github.com/aspnet/Mvc/issues/4257#issuecomment-210610663","issue_url":"https://api.github.com/repos/aspnet/Mvc/issues/4257","id":210610663,"user":{"login":"rynowak","id":1430011,"avatar_url":"https://avatars.githubusercontent.com/u/1430011?v=3","gravatar_id":"","url":"https://api.github.com/users/rynowak","html_url":"https://github.com/rynowak","followers_url":"https://api.github.com/users/rynowak/followers","following_url":"https://api.github.com/users/rynowak/following{/other_user}","gists_url":"https://api.github.com/users/rynowak/gists{/gist_id}","starred_url":"https://api.github.com/users/rynowak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rynowak/subscriptions","organizations_url":"https://api.github.com/users/rynowak/orgs","repos_url":"https://api.github.com/users/rynowak/repos","events_url":"https://api.github.com/users/rynowak/events{/privacy}","received_events_url":"https://api.github.com/users/rynowak/received_events","type":"User","site_admin":false},"created_at":"2016-04-15T19:37:08Z","updated_at":"2016-04-15T19:37:08Z","body":"Is there an exception thrown?"}}