http_interceptor
http_interceptor copied to clipboard
Using interceptors on multipart request
When i use a logging interceptor on a multipart request it returns StreamedResponse and if i listen to this object i get "Bad state exception stream has already been listened to"
Any fix for this ? I am getting the same issue.
Hi, I'm looking into it, however I do this on my spare time, which is definitely not enough. Pull requests are always welcomed though. 😄
At the moment, the way that you can work with Multipart Requests would be to do something like in the example project. In there, you'll find a way to do requests without necessarily needing to listen to the stream.
I'm still looking for a way to "clone" the stream and data into a new one without having the stream either closed or listened to but it might take me a while to figure out a scalable solution.
Its the same implementation on the example code that I used but it still has the same issue
What I meant with the example is that you might not need to listen to the stream, or is there any specific reason that you ~~want~~ need to do that?
When I don't listen to the stream the logged response is StreamedResponse object
Yes, you could work with the StreamedResponse
like in the Multipart Request example. You would parse the StreamedResponse to a Response and do what you need with it.
At least if you don't depend on listen
. If you do then I would ask for a bit more patience since I can't look at it at the moment. Sorry it takes too long to get things done!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Any progress with fixing issue ?