JAX-RS 2.0-Client - senden von multipart-Nachricht mit RESTEasy-client

Ich bin mit RESTEasy-client.

Maven dependency:

<dependency>
    <groupId>org.jboss.resteasy</groupId>
    <artifactId>resteasy-client</artifactId>
    <version>3.0.1.Final</version>
</dependency>

Und ich weiß nicht, wie zu nennen, auf webresource mit multipart?

Auf server-Seite die Methode, die wie folgt definiert sind:

@PUT
@Consumes(MimeHelp.MULTIPART_FORM_DATA)
@Produces(MimeHelp.JSON_UTF8)
@Path("/path")
public Response multipart(@Multipart(value = "firstPart", type = "text/plain") InputStream firstStream,
                          @Multipart(value = "secondPart", type = "text/plain") InputStream secondStream) {

Und jetzt bitte helfen Sie mir mit der client-code

WebTarget target = client.target("http://localhost:8080").path("path");
//TODO somehow fill multipart
Response response = target.request().put(/*RESTEasy multipart entity or something*/);
response.close();

InformationsquelleAutor bugs_ | 2014-05-13

Schreibe einen Kommentar