Http ResponseType cannot be set
## I'm submitting a... <!-- Check one of the following options with "x" --> <pre><code> [ ] Regression (a behavior that used to work and stopped working in a new release) [x] Bug report <!-- Please search GitHub for a similar issue or PR before submitting --> [ ] Feature request [ ] Documentation issue or request [ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question </code></pre> ## Current behavior Response type cannot be set for HttpClient methods. ``` const options = {headers: headers, params: params, responseType: 'text'}; return this.http.get(url, options).share(); ``` Would show an error ``` Types of property 'responseType' are incompatible. Type 'string' is not assignable to type '"json"'. ``` ## Expected behavior It is expected that the response type should be exported like ``` export type ResponseType = 'arraybuffer' | 'blob' | 'json' | 'text';; ``` And one would be able to set it using this type. Otherwise the type cannot be changed. ## Environment Angular version: 4.1.1 and still there in 5.0.0-beta.2 as seen here: https://github.com/angular/angular/blob/master/packages/common/http/src/client.ts
Posted by zaiddabaeen on Aug 8, 2017, 3:32 PM
Tags
Related issues
- Add 65536 size support for maps
- TypeScript 7.1 Iteration Plan
- nvim-treeconfig: upstream nvim-treesitter
- Add the "action" and "method" attributes to <button>
- [FEATURE] Support multiple Connector accounts (same connector, different accounts) in Claude and Claude Code on the web (claude.ai/code)
- > We were imposed GitHub for so many exercises!
Raise real-world problems, find people facing the same issue, and discuss solutions.4,500 issues0 comments
support (Software)
Add 65536 size support for maps
TypeScript 7.1 Iteration Plan
nvim-treeconfig: upstream nvim-treesitter
Add the "action" and "method" attributes to <button>
[FEATURE] Support multiple Connector accounts (same connector, different accounts) in Claude and Claude Code on the web (claude.ai/code)
> We were imposed GitHub for so many exercises!
Add support for Visual Studio 2026 Integration
Support for Helm v4
Http ResponseType cannot be set
## I'm submitting a... <!-- Check one of the following options with "x" --> <pre><code> [ ] Regression (a behavior that used to work and stopped working in a new release) [x] Bug report <!-- Please search GitHub for a similar issue or PR before submitting --> [ ] Feature request [ ] Documentation issue or request [ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question </code></pre> ## Current behavior Response type cannot be set for HttpClient methods. ``` const options = {headers: headers, params: params, responseType: 'text'}; return this.http.get(url, options).share(); ``` Would show an error ``` Types of property 'responseType' are incompatible. Type 'string' is not assignable to type '"json"'. ``` ## Expected behavior It is expected that the response type should be exported like ``` export type ResponseType = 'arraybuffer' | 'blob' | 'json' | 'text';; ``` And one would be able to set it using this type. Otherwise the type cannot be changed. ## Environment Angular version: 4.1.1 and still there in 5.0.0-beta.2 as seen here: https://github.com/angular/angular/blob/master/packages/common/http/src/client.ts
Comments (0)
No comments yet. Start the discussion.