2

I managed to upload the blob from Javascript to Java Endpointfunction

Javascript

var request = gapi.client.helloworldendpoints.uploadImage({
    'imageData': __upload.imageData, 
    'fileName': __upload.fileName, 
    'mimeType': __upload.mimeType, 
    'size': __upload.size
});

Java Endpoint

public ImageUploadRequest uploadImage(
    Request imageData, 
    @Named("fileName") String fileName, 
    @Named("mimeType") String mimeType, 
    @Named("size") float size
) { ... }

Request is just this

public class Request {
      public Blob image;
}

Now i want to send a MultipartRequest from my Java Endpoint at GAE to my UploadServlet to create a blobkey and save the data into blobstorage, since Blobstorage only accepts data send to servlet. How can I create a MultipartRequest?

Laslo89
  • 105
  • 7

1 Answers1

0

There are numerous ways to construct an HTTP request in Java. This question, while dealing with some very specific systems, is too broad for Stack Overflow, since the real question is "how can I build and execute a multi-part/form-data request in Java?" You should look into the UrlFetch service on App Engine, since this is how all HTTP requests are sent. You can find examples of HTTP requests in Java all over the internet.

Community
  • 1
  • 1
Nick
  • 3,581
  • 1
  • 14
  • 36