Title: feat(http): accept string for method in RequestOptions class and interface · Issue #2840 · angular/angular · GitHub
Open Graph Title: feat(http): accept string for method in RequestOptions class and interface · Issue #2840 · angular/angular
X Title: feat(http): accept string for method in RequestOptions class and interface · Issue #2840 · angular/angular
Description: Currently, the method must be of the ResponseMethods TypeScript enum, which is really an integer. So to create a request in TypeScript, one would use the enum to describe the method instead of passing in the method string: var options = ...
Open Graph Description: Currently, the method must be of the ResponseMethods TypeScript enum, which is really an integer. So to create a request in TypeScript, one would use the enum to describe the method instead of pass...
X Description: Currently, the method must be of the ResponseMethods TypeScript enum, which is really an integer. So to create a request in TypeScript, one would use the enum to describe the method instead of pass...
Opengraph URL: https://github.com/angular/angular/issues/2840
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"feat(http): accept string for method in RequestOptions class and interface","articleBody":"Currently, the method must be of the `ResponseMethods` TypeScript enum, which is really an integer. So to create a request in TypeScript, one would use the enum to describe the method instead of passing in the method string:\n\n``` typescript\nvar options = new RequestOptions({\n url: '/foo.json',\n method: RequestMethods.POST\n});\nvar request = new Request(options);\n```\n\nThis adds some convenience for TypeScript and Dart users to get some IDE/compiler help to make sure the method is a valid value. But plain old ES5 users probably don't want to pass `0` as the method value. Instead, `RequestOptions` should have the `method` property be a union type of `RequestMethods | string`, and should validate the provided string \u0026 throw if not a recognized method.\n\nI'm not sure `Request` class needs to accept method as a string though. Ideally, we could reduce instances of type ambiguity to public APIs.\n","author":{"url":"https://github.com/jeffbcross","@type":"Person","name":"jeffbcross"},"datePublished":"2015-07-01T23:53:52.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":8},"url":"https://github.com/2840/angular/issues/2840"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:b59cc706-b322-2f31-0b24-469c30c6ef8e |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D954:3C5C87:82A7E9:BBFB53:6A606C5F |
| html-safe-nonce | aa8e8cea1c4da5c1f5766304ec90a6a7c631ff02dd69a8c11592b9bdc2d82de3 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEOTU0OjNDNUM4Nzo4MkE3RTk6QkJGQjUzOjZBNjA2QzVGIiwidmlzaXRvcl9pZCI6IjU4MDY1NjA4NjQxNTA1MTQ3ODMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 9dc64a17b57a1c64f933f8a98f03c2c71fd2da39cc407e448ea97c0683d0d42d |
| hovercard-subject-tag | issue:92510760 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular/2840/issue_layout |
| twitter:image | https://opengraph.githubassets.com/085d78ecfb82f283169b4e2343a7f4ce5e61f4942b3088d2e397cb1cfe605b73/angular/angular/issues/2840 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/085d78ecfb82f283169b4e2343a7f4ce5e61f4942b3088d2e397cb1cfe605b73/angular/angular/issues/2840 |
| og:image:alt | Currently, the method must be of the ResponseMethods TypeScript enum, which is really an integer. So to create a request in TypeScript, one would use the enum to describe the method instead of pass... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | jeffbcross |
| hostname | github.com |
| expected-hostname | github.com |
| None | 60da8c2a42fa2bbf5f7567474990ec467836a84444262a58e200fa91b7f3d2d0 |
| turbo-cache-control | no-preview |
| go-import | github.com/angular/angular git https://github.com/angular/angular.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 24195339 |
| octolytics-dimension-repository_nwo | angular/angular |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 24195339 |
| octolytics-dimension-repository_network_root_nwo | angular/angular |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 9824515e740d83d5eb82168a089b806ab0fe04a1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width