Skip to content

Conversation

@twsouthwick
Copy link
Member

Fixes #150

return _bufferedStream;
}

throw new InvalidOperationException("InputStream must be prebuffered");
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could remove this requirement and provide an API similar to what is described in #164 for HttpRequest.GetInputStreamAsync() that would do the awaiting there. This then could block and wait with the recommendation people move to the async version

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For reference, this blocks on framework so is not a real change. Non-blocking APIs are the now available GetBufferedStream and GetBufferlessStream

@twsouthwick twsouthwick enabled auto-merge (squash) August 25, 2022 21:28
@twsouthwick twsouthwick merged commit 72bdd46 into main Aug 25, 2022
@twsouthwick twsouthwick deleted the tasou/request-feature branch August 25, 2022 22:04

return body;
}
set => _other.Body = value;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should Mode be updated if the stream is replaced?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_bufferedStream as well?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had thought about it, but wasn't sure how necessary it would be. Pushed a PR to reset in that case

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enable HttpRequest.ReadEntityBodyMode/GetBuffer[ed|less]InputStream()

4 participants