{"action":"created","issue":{"url":"https://api.github.com/repos/angular/angular/issues/25407","repository_url":"https://api.github.com/repos/angular/angular","labels_url":"https://api.github.com/repos/angular/angular/issues/25407/labels{/name}","comments_url":"https://api.github.com/repos/angular/angular/issues/25407/comments","events_url":"https://api.github.com/repos/angular/angular/issues/25407/events","html_url":"https://github.com/angular/angular/issues/25407","id":349122823,"node_id":"MDU6SXNzdWUzNDkxMjI4MjM=","number":25407,"title":"HttpRequest method field typing","user":{"login":"michahell","id":225784,"node_id":"MDQ6VXNlcjIyNTc4NA==","avatar_url":"https://avatars3.githubusercontent.com/u/225784?v=4","gravatar_id":"","url":"https://api.github.com/users/michahell","html_url":"https://github.com/michahell","followers_url":"https://api.github.com/users/michahell/followers","following_url":"https://api.github.com/users/michahell/following{/other_user}","gists_url":"https://api.github.com/users/michahell/gists{/gist_id}","starred_url":"https://api.github.com/users/michahell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michahell/subscriptions","organizations_url":"https://api.github.com/users/michahell/orgs","repos_url":"https://api.github.com/users/michahell/repos","events_url":"https://api.github.com/users/michahell/events{/privacy}","received_events_url":"https://api.github.com/users/michahell/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":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/angular/angular/milestones/83","html_url":"https://github.com/angular/angular/milestone/83","labels_url":"https://api.github.com/repos/angular/angular/milestones/83/labels","id":3143880,"node_id":"MDk6TWlsZXN0b25lMzE0Mzg4MA==","number":83,"title":"needsTriage","description":"Milestone for all issues that haven't been triaged yet","creator":{"login":"ocombe","id":265378,"node_id":"MDQ6VXNlcjI2NTM3OA==","avatar_url":"https://avatars0.githubusercontent.com/u/265378?v=4","gravatar_id":"","url":"https://api.github.com/users/ocombe","html_url":"https://github.com/ocombe","followers_url":"https://api.github.com/users/ocombe/followers","following_url":"https://api.github.com/users/ocombe/following{/other_user}","gists_url":"https://api.github.com/users/ocombe/gists{/gist_id}","starred_url":"https://api.github.com/users/ocombe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ocombe/subscriptions","organizations_url":"https://api.github.com/users/ocombe/orgs","repos_url":"https://api.github.com/users/ocombe/repos","events_url":"https://api.github.com/users/ocombe/events{/privacy}","received_events_url":"https://api.github.com/users/ocombe/received_events","type":"User","site_admin":false},"open_issues":200,"closed_issues":552,"state":"open","created_at":"2018-02-26T14:22:18Z","updated_at":"2018-08-09T19:53:43Z","due_on":null,"closed_at":null},"comments":0,"created_at":"2018-08-09T13:15:40Z","updated_at":"2018-08-09T21:00:43Z","closed_at":null,"author_association":"NONE","body":"<!--\r\nPLEASE HELP US PROCESS GITHUB ISSUES FASTER BY PROVIDING THE FOLLOWING INFORMATION.\r\n\r\nISSUES MISSING IMPORTANT INFORMATION MAY BE CLOSED WITHOUT INVESTIGATION.\r\n-->\r\n\r\n## 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[ ] Bug report  <!-- Please search GitHub for a similar issue or PR before submitting -->\r\n[ ] Performance issue\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[x] Other... Please describe: question regarding missing typings\r\n</code></pre>\r\n\r\n## Current behavior\r\n<!-- Describe how the issue manifests. -->\r\nin Http Interceptors the HttpRequest object passed in the `intercept` method has a public `method` field:\r\nhttps://github.com/angular/angular/blob/master/packages/common/http/src/request.ts#L118\r\nWhy is this field not typed as String literal with all the possible HTTP verbs ?\r\n\r\nFor instance, I could do `req.method === 'BLA'` and the TSC compiler would not catch this as a compile-time bug.\r\n\r\n## Expected behavior\r\n<!-- Describe what the desired behavior would be. -->\r\nthe method field would be typed as it is in the `constructor`, like so:\r\n`method: 'DELETE' | 'GET' | 'HEAD' | 'JSONP' | 'OPTIONS'`\r\n\r\n## Minimal reproduction of the problem with instructions\r\n<!--\r\nFor bug reports please provide the *STEPS TO REPRODUCE* and if possible a *MINIMAL DEMO* of the problem via\r\nhttps://stackblitz.com or similar (you can use this template as a starting point: https://stackblitz.com/fork/angular-gitter).\r\n-->\r\n\r\n## What is the motivation / use case for changing the behavior?\r\n<!-- Describe the motivation or the concrete use case. -->\r\n\r\n\r\n## Environment\r\n\r\n<pre><code>\r\nAngular version: 6.0.5, but irrelevant, in the latest source code the field is still typed as `string`.\r\n\r\nBrowser:\r\n- N/A\r\n \r\nFor Tooling issues:\r\n- N/A\r\n\r\nOthers:\r\n- N/A\r\n"},"comment":{"url":"https://api.github.com/repos/angular/angular/issues/comments/411895516","html_url":"https://github.com/angular/angular/issues/25407#issuecomment-411895516","issue_url":"https://api.github.com/repos/angular/angular/issues/25407","id":411895516,"node_id":"MDEyOklzc3VlQ29tbWVudDQxMTg5NTUxNg==","user":{"login":"textbook","id":785939,"node_id":"MDQ6VXNlcjc4NTkzOQ==","avatar_url":"https://avatars2.githubusercontent.com/u/785939?v=4","gravatar_id":"","url":"https://api.github.com/users/textbook","html_url":"https://github.com/textbook","followers_url":"https://api.github.com/users/textbook/followers","following_url":"https://api.github.com/users/textbook/following{/other_user}","gists_url":"https://api.github.com/users/textbook/gists{/gist_id}","starred_url":"https://api.github.com/users/textbook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/textbook/subscriptions","organizations_url":"https://api.github.com/users/textbook/orgs","repos_url":"https://api.github.com/users/textbook/repos","events_url":"https://api.github.com/users/textbook/events{/privacy}","received_events_url":"https://api.github.com/users/textbook/received_events","type":"User","site_admin":false},"created_at":"2018-08-09T21:00:43Z","updated_at":"2018-08-09T21:00:43Z","author_association":"CONTRIBUTOR","body":"_\"I could do `req.method === 'BLA'`\"_ - did you try that? It's `readonly`; in fact the whole `HttpRequest` is immutable, as mentioned in [the interceptor section of the docs](https://angular.io/guide/http#immutability)."}}
{"actor":{"display_login":"textbook"}}