{"action":"created","issue":{"url":"https://api.github.com/repos/angular/angular/issues/18586","repository_url":"https://api.github.com/repos/angular/angular","labels_url":"https://api.github.com/repos/angular/angular/issues/18586/labels{/name}","comments_url":"https://api.github.com/repos/angular/angular/issues/18586/comments","events_url":"https://api.github.com/repos/angular/angular/issues/18586/events","html_url":"https://github.com/angular/angular/issues/18586","id":248755857,"node_id":"MDU6SXNzdWUyNDg3NTU4NTc=","number":18586,"title":"Http ResponseType cannot be set","user":{"login":"zaiddabaeen","id":5732288,"node_id":"MDQ6VXNlcjU3MzIyODg=","avatar_url":"https://avatars1.githubusercontent.com/u/5732288?v=4","gravatar_id":"","url":"https://api.github.com/users/zaiddabaeen","html_url":"https://github.com/zaiddabaeen","followers_url":"https://api.github.com/users/zaiddabaeen/followers","following_url":"https://api.github.com/users/zaiddabaeen/following{/other_user}","gists_url":"https://api.github.com/users/zaiddabaeen/gists{/gist_id}","starred_url":"https://api.github.com/users/zaiddabaeen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zaiddabaeen/subscriptions","organizations_url":"https://api.github.com/users/zaiddabaeen/orgs","repos_url":"https://api.github.com/users/zaiddabaeen/repos","events_url":"https://api.github.com/users/zaiddabaeen/events{/privacy}","received_events_url":"https://api.github.com/users/zaiddabaeen/received_events","type":"User","site_admin":false},"labels":[{"id":279828207,"node_id":"MDU6TGFiZWwyNzk4MjgyMDc=","url":"https://api.github.com/repos/angular/angular/labels/comp:%20http","name":"comp: http","color":"c7def8","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":41,"created_at":"2017-08-08T15:32:17Z","updated_at":"2018-07-20T03:35:25Z","closed_at":"2017-11-28T23:24:47Z","author_association":"NONE","body":"## I'm submitting a...\r\n<!-- Check one of the following options with \"x\" -->\r\n<pre><code>\r\n[ ] Regression (a behavior that used to work and stopped working in a new release)\r\n[x] Bug report  <!-- Please search GitHub for a similar issue or PR before submitting -->\r\n[ ] Feature request\r\n[ ] Documentation issue or request\r\n[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question\r\n</code></pre>\r\n\r\n## Current behavior\r\nResponse type cannot be set for HttpClient methods.\r\n\r\n```\r\n        const options = {headers: headers, params: params, responseType: 'text'};\r\n\r\n        return this.http.get(url, options).share();\r\n```\r\n\r\nWould show an error \r\n\r\n```        \r\n  Types of property 'responseType' are incompatible.\r\n    Type 'string' is not assignable to type '\"json\"'.\r\n```\r\n\r\n## Expected behavior\r\nIt is expected that the response type should be exported like \r\n```\r\nexport type ResponseType = 'arraybuffer' | 'blob' | 'json' | 'text';;\r\n```\r\n\r\nAnd one would be able to set it using this type. Otherwise the type cannot be changed.\r\n\r\n## Environment\r\n\r\nAngular version: 4.1.1 and still there in 5.0.0-beta.2\r\nas seen here: https://github.com/angular/angular/blob/master/packages/common/http/src/client.ts"},"comment":{"url":"https://api.github.com/repos/angular/angular/issues/comments/406479493","html_url":"https://github.com/angular/angular/issues/18586#issuecomment-406479493","issue_url":"https://api.github.com/repos/angular/angular/issues/18586","id":406479493,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNjQ3OTQ5Mw==","user":{"login":"pnemere","id":10591046,"node_id":"MDQ6VXNlcjEwNTkxMDQ2","avatar_url":"https://avatars0.githubusercontent.com/u/10591046?v=4","gravatar_id":"","url":"https://api.github.com/users/pnemere","html_url":"https://github.com/pnemere","followers_url":"https://api.github.com/users/pnemere/followers","following_url":"https://api.github.com/users/pnemere/following{/other_user}","gists_url":"https://api.github.com/users/pnemere/gists{/gist_id}","starred_url":"https://api.github.com/users/pnemere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pnemere/subscriptions","organizations_url":"https://api.github.com/users/pnemere/orgs","repos_url":"https://api.github.com/users/pnemere/repos","events_url":"https://api.github.com/users/pnemere/events{/privacy}","received_events_url":"https://api.github.com/users/pnemere/received_events","type":"User","site_admin":false},"created_at":"2018-07-20T03:35:25Z","updated_at":"2018-07-20T03:35:25Z","author_association":"NONE","body":"Please mention this in:\r\n\r\nhttps://angular.io/guide/http#requesting-non-json-data\r\n\r\nI don't get it though - ng serve blows up with:\r\n\r\nERROR in src/app/shared/api.service.ts(937,68): error TS2345: Argument of type '{ responseType: \"text\"; }' is not assignable to parameter of type '{ headers?: HttpHeaders | { [header: string]: string | string[]; }; observe?: \"body\"; params?: Ht...'.\r\n  Types of property 'responseType' are incompatible.\r\n    Type '\"text\"' is not assignable to type '\"json\"'.\r\n\r\nBut it works fine... so is this just a typescript issue and it somehow still does get transpiled into javascript & works?\r\n\r\nEnum would've been nicer though..."}}
{"actor":{"display_login":"pnemere"}}