-
Notifications
You must be signed in to change notification settings - Fork 316
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
How to set 'body' on constructed responses #192
Comments
Clarification:
@mattto: I've also changed the title of the ticket, let me know if this isn't what you were asking. |
The body property on responses is likely to be a stream (https://github.com/whatwg/streams). How about
|
I like this but it brings up an issue I had doing the prototype - I ran into some conflicts between the body content-type and the headers.. so I'd like to make sure that this works:
basically I think we need to think about which content-type overrides which if both headers and the response have a content-type. (Because I wonder if a Blob's content-type should override the header, if the body is a blob, but the other way around for strings? that seems inconsistent though) |
I think the explicit header should override the implicit content-type of the blob/arraybuffer/string |
Yeah, that's why I put the body param first, so anything in the options obj would overwrite any defaults determined from the first param |
It gets more complicated if you allow response.body = "Hello world";
// is response.body still a Stream, but for the content "Hello world"?
// Does it change the content header to text/plain? |
Changing the content header I would see it as a side effect, so I would |
Any objection to
Setting This is similar to the previous proposal, except text no longer sets content-type. |
Do we want to mimic new Request()? |
We should support |
Okay, setting |
http://crbug.com/411743 and http://crbug.com/410196 should be covering the latest here for Blink. |
The .ts file has a FIXME for this. Is there a plan for what to do?
The text was updated successfully, but these errors were encountered: