-
Notifications
You must be signed in to change notification settings - Fork 13
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 support of multipart form data #104
Comments
Can you clarify whether I would also need a use case. Is this similar to |
Took this Part interface from Spring. Don't know if there is analogue interface in Jetty. |
Exactly |
Upvoting this |
We have https://github.com/eclipse/jetty.project/blob/f98b345a28fcefbf1fa8e16dc4b44605b68f2c62/jetty-core/jetty-http/src/main/java/org/eclipse/jetty/http/MultiPart.java#L122 However, I do not think we make available a stream of those parts, only the collection of all If we do this, it would likely be in the form of a jetty-12 style demand interface, but that is trivially convertible to a Publisher. @lachlan-roberts thoughts? |
@gregw I don't think this issue is asking to be able to stream the parts which have been received, but to publish parts to be sent into a But I think this is easily done. I think this should work? static Content fromParts(Flow.Publisher<MultiPart.Part> publisher)
{
MultiPartRequestContent content = new MultiPartRequestContent();
publisher.subscribe(new Flow.Subscriber<>()
{
private Flow.Subscription _subscription;
@Override
public void onSubscribe(Flow.Subscription subscription)
{
_subscription = subscription;
_subscription.request(1);
}
@Override
public void onNext(MultiPart.Part item)
{
content.addPart(item);
_subscription.request(1);
}
@Override
public void onError(Throwable throwable)
{
content.fail(throwable);
}
@Override
public void onComplete()
{
content.close();
}
});
return content;
} |
@lachlan-roberts yes the idea is correct, but we don't have |
By "stream the parts" I mean publish them through a Are you sure this is a publish parts sent, rather than to be subscribed to parts received? |
@gregw this is the reactive client, so we need the "reactive" to both send and receive, although the receive part must be done by the application, so we can only provide utilities to take a reactive response body and turn it into reactive parts. |
Provide utility method
Request.Content.fromParts(Publisher<Part>)
where Part
The text was updated successfully, but these errors were encountered: