{"action":"created","issue":{"url":"https://api.github.com/repos/Azure/autorest/issues/673","repository_url":"https://api.github.com/repos/Azure/autorest","labels_url":"https://api.github.com/repos/Azure/autorest/issues/673/labels{/name}","comments_url":"https://api.github.com/repos/Azure/autorest/issues/673/comments","events_url":"https://api.github.com/repos/Azure/autorest/issues/673/events","html_url":"https://github.com/Azure/autorest/issues/673","id":130652988,"number":673,"title":"Streaming non file content using C# client generator","user":{"login":"henning-krause","id":12197701,"avatar_url":"https://avatars.githubusercontent.com/u/12197701?v=3","gravatar_id":"","url":"https://api.github.com/users/henning-krause","html_url":"https://github.com/henning-krause","followers_url":"https://api.github.com/users/henning-krause/followers","following_url":"https://api.github.com/users/henning-krause/following{/other_user}","gists_url":"https://api.github.com/users/henning-krause/gists{/gist_id}","starred_url":"https://api.github.com/users/henning-krause/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/henning-krause/subscriptions","organizations_url":"https://api.github.com/users/henning-krause/orgs","repos_url":"https://api.github.com/users/henning-krause/repos","events_url":"https://api.github.com/users/henning-krause/events{/privacy}","received_events_url":"https://api.github.com/users/henning-krause/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Azure/autorest/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/Azure/autorest/milestones/5","html_url":"https://github.com/Azure/autorest/milestones/Data%20Plane","labels_url":"https://api.github.com/repos/Azure/autorest/milestones/5/labels","id":1616652,"number":5,"title":"Data Plane","description":"AutoRest working for not just Azure Management, but for consumption of Azure Services.","creator":{"login":"azuresdkci","id":1087595,"avatar_url":"https://avatars.githubusercontent.com/u/1087595?v=3","gravatar_id":"","url":"https://api.github.com/users/azuresdkci","html_url":"https://github.com/azuresdkci","followers_url":"https://api.github.com/users/azuresdkci/followers","following_url":"https://api.github.com/users/azuresdkci/following{/other_user}","gists_url":"https://api.github.com/users/azuresdkci/gists{/gist_id}","starred_url":"https://api.github.com/users/azuresdkci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/azuresdkci/subscriptions","organizations_url":"https://api.github.com/users/azuresdkci/orgs","repos_url":"https://api.github.com/users/azuresdkci/repos","events_url":"https://api.github.com/users/azuresdkci/events{/privacy}","received_events_url":"https://api.github.com/users/azuresdkci/received_events","type":"User","site_admin":false},"open_issues":16,"closed_issues":0,"state":"open","created_at":"2016-03-01T23:38:06Z","updated_at":"2016-03-14T22:24:55Z","due_on":"2016-07-01T07:00:00Z","closed_at":null},"comments":2,"created_at":"2016-02-02T11:22:14Z","updated_at":"2016-04-26T05:41:22Z","closed_at":null,"body":"\r\nI have a Web API controller which is used to upload images. To avoid Base64 conversion I would like to upload the data using the new Stream feature of Autorest. \r\n\r\nMy action definition now looks liks this:\r\n```javascript\r\n\"/api/Images/new\": {\r\n\t\t\t\"post\": {\r\n\t\t\t\t\"tags\": [ \"Image\" ],\r\n\t\t\t\t\"operationId\": \"Image_Add\",\r\n\t\t\t\t\"consumes\": [ \"application/octet-stream\" ],\r\n\t\t\t\t\"produces\": [ \"application/json\", \"text/json\" ],\r\n\t\t\t\t\"parameters\": [\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t\"name\": \"File\",\r\n\t\t\t\t\t\t\"required\": true,\r\n\t\t\t\t\t\t\"allowMultiple\": false,\r\n\t\t\t\t\t\t\"type\": \"object\",\r\n\t\t\t\t\t\t\"format\": \"file\",\r\n\t\t\t\t\t\t\"in\": \"formdata\"\r\n\t\t\t\t\t}\r\n\t\t\t\t],\r\n\t\t\t\t],\r\n\t\t\t\t\"responses\": {\r\n\t\t\t\t\t\"200\": {\r\n\t\t\t\t\t\t\"description\": \"OK\",\r\n\t\t\t\t\t\t\"schema\": { \"$ref\": \"#/definitions/ImageInfo\" }\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t\t\"deprecated\": false\r\n\t\t\t}\r\n\t\t}\r\n```\r\n\r\nAutoRest correctly builds the stream request with this. However, itwill only add a Content-Disposition header with a \"filename\" value when the input stream is a FileStream.\r\n\r\nWould it be possible to change the signature of the generated method from\r\n\r\n```cs\r\nTask<HttpOperationResponse<ImageInfo>> AddWithHttpMessagesAsync(System.IO.Stream file, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));\r\n```\r\n\r\nto \r\n\r\n```cs\r\nTask<HttpOperationResponse<ImageInfo>> AddWithHttpMessagesAsync(System.IO.Stream file, string fileName, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));\r\n```\r\nand use the second parameter as the filename? It could even be optional. Naming convention would be <Name of the stream parameter> + \"Name\".\n<!---@tfsbridge:{\"tfsId\":5694127}-->"},"comment":{"url":"https://api.github.com/repos/Azure/autorest/issues/comments/214621561","html_url":"https://github.com/Azure/autorest/issues/673#issuecomment-214621561","issue_url":"https://api.github.com/repos/Azure/autorest/issues/673","id":214621561,"user":{"login":"centur","id":720822,"avatar_url":"https://avatars.githubusercontent.com/u/720822?v=3","gravatar_id":"","url":"https://api.github.com/users/centur","html_url":"https://github.com/centur","followers_url":"https://api.github.com/users/centur/followers","following_url":"https://api.github.com/users/centur/following{/other_user}","gists_url":"https://api.github.com/users/centur/gists{/gist_id}","starred_url":"https://api.github.com/users/centur/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/centur/subscriptions","organizations_url":"https://api.github.com/users/centur/orgs","repos_url":"https://api.github.com/users/centur/repos","events_url":"https://api.github.com/users/centur/events{/privacy}","received_events_url":"https://api.github.com/users/centur/received_events","type":"User","site_admin":false},"created_at":"2016-04-26T05:41:22Z","updated_at":"2016-04-26T05:41:22Z","body":"Well we have similar issue for UWP application, so I subscribe to this either. I hope not having a working code on Microsoft's UWP  - most pushed forward Windows 10 apps platform makes this issue progress a bit faster."}}