-
Notifications
You must be signed in to change notification settings - Fork 26.7k
Open
Labels
area: common/httpIssues related to HTTP and HTTP ClientIssues related to HTTP and HTTP ClientfeatureIssue that requests a new featureIssue that requests a new featurefeature: under considerationFeature request for which voting has completed and the request is now under considerationFeature request for which voting has completed and the request is now under consideration
Milestone
Description
I'm submitting a...
[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report
[ ] 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
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
lorenzodianni, harshes53, will-wow, chrillewoodz, roddy and 119 more
Metadata
Metadata
Assignees
Labels
area: common/httpIssues related to HTTP and HTTP ClientIssues related to HTTP and HTTP ClientfeatureIssue that requests a new featureIssue that requests a new featurefeature: under considerationFeature request for which voting has completed and the request is now under considerationFeature request for which voting has completed and the request is now under consideration