Skip to content
This repository has been archived by the owner on Nov 20, 2018. It is now read-only.

Request.Form throws 'Unexpected end of stream` if Request.Body was read #625

Closed
pakrym opened this issue May 5, 2016 · 4 comments
Closed
Assignees

Comments

@pakrym
Copy link
Contributor

pakrym commented May 5, 2016

using (var streamReader = new StreamReader(context.Request.Body))
{
    streamReader.ReadToEnd();
}
if (context.Request.HasFormContentType) { 
    var form = context.Request.Form; // << exception here
}   

Can we give better error message?

@Tratcher
Copy link
Member

Tratcher commented May 5, 2016

Was this for form or multipart form?

Recommendation?

@pakrym
Copy link
Contributor Author

pakrym commented May 5, 2016

It was multipart form. Something like Could not read Form after request body have been read would be more descriptive I think.

@danroth27 danroth27 added this to the Backlog milestone May 9, 2016
@danroth27 danroth27 added the bug label May 9, 2016
@Tratcher
Copy link
Member

Unexpected end of Stream, the content may have already been read by another component.?

@pakrym
Copy link
Contributor Author

pakrym commented Jun 15, 2016

Sounds good.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants