-
Notifications
You must be signed in to change notification settings - Fork 51
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
Add SendResponse Overloads for Byte Array and MemoryStream #164
Comments
I like this; it's caused me to rethink the options I've provided for sending responses. Here's what I think should be done to provide the biggest bang for the buck, and allow for maximum reusability and extensibility with the least impact to the existing user base.
This would mean that the next time a new Thoughts? Objections? Praise? |
Looks good. This should clear up the interface, but still providing reach functionality as before. |
I have the initial work for this one up in it's own branch. I just need to double-check code coverage and then I can merge this into master. |
This moves functionality for sending responses primarily to extension methods, while HttpResponse only exposes a single SendResponse method (one that takes a byte array). All extension methods simply set properties and then create a byte array from the response body. Extension methods will now opperate on a Stream object instead of specifically on a FileStream object, allowing the data to be sent to come from any stream, while also allowing *Stream specific overloads to be written for specific cases. Resolves Issue #164
This moves functionality for sending responses primarily to extension methods, while HttpResponse only exposes a single SendResponse method (one that takes a byte array). All extension methods simply set properties and then create a byte array from the response body. Extension methods will now opperate on a Stream object instead of specifically on a FileStream object, allowing the data to be sent to come from any stream, while also allowing *Stream specific overloads to be written for specific cases. Resolves Issue #164
Right now Grapevine only supports text responses or filestream responses. It would be nice if you could also respond with an array of bytes or memory stream (I think internally it is available, so just need to make it public)
Also I'm not sure what headers are necessary to set if you want to sent let's say image as byte array - so it would be nice if API could handle that (but this is optional as API already provides a way to set headers manually)
The text was updated successfully, but these errors were encountered: