New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(http): add support for blob as a response type #10190
Conversation
Allow to set the attribute responseType of the request, through the enum ResponseContentType.
related to angular/http#75 ? |
@@ -179,14 +179,15 @@ export declare class Response extends Body { | |||
|
|||
/** @experimental */ | |||
export declare enum ResponseContentType { | |||
ArrayBuffer = 0, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need to explicitly assign value here ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is generated by the command gulp public-api:update
, if the values are not explicitly assigned, then any call to gulp public-api:update
will put back the values.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you're right. didn't notice it was a .d.ts file before
Please add tests. Thanks |
Expose a spy to test change on responseType, which allow to test responseType in XHRBackend on PR angular#7260 and PR angular#10190
@cassand please merge both the PRs and add tests. Thanks |
Test if the attribute responseType of the request is correctly set when the corresponding response content type is passed.
Both requests are merged and the feature is tested. |
I'm forced to ask here as i don't got any response from gitter. Any example showcasing sending Below code works fine for me but like to know if same supported in
How to make below code work?
I have posted same here also http://stackoverflow.com/questions/39731066/how-to-upload-filesmultipart-using-angularjs2 |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Please check if the PR fulfills these requirements
What kind of change does this PR introduce? (check one with "x")
What is the current behavior?
There is no way to receive a response as a blob.
What is the new behavior?
Allow to set the attribute responseType of the request, through the enum ResponseContentType.
Does this PR introduce a breaking change? (check one with "x")
Other information:
In order to add appropriate tests for this feature I have to introduce some change into the MockBrowserXHR, (which will also allow to test arraybuffer, json and text as a responseType), therefore I will add them in a future commit.