0

Hi how do I get multipart form data in case of Java Azure Function Apps ?

I have looked at the this but there is no mention of multipart form data

public HttpResponseMessage run(
            @HttpTrigger(
                name = "req",
                methods = {HttpMethod.POST},
                authLevel = AuthorizationLevel.ANONYMOUS)
                HttpRequestMessage<Optional<String>> request,
            final ExecutionContext context) {
        context.getLogger().info("Java HTTP trigger processed a request.");

        // This gives me the whole body
        final String file = request.getBody().get();

        System.out.println(file);

}

How can I filter out just my upload ?

I seem to be having no API for this. I can access the whole body and that's it.

How do I do this in Java ?

ng.newbie
  • 2,807
  • 3
  • 23
  • 57
  • 1
    There seems to be no simple solution for this. See also: https://stackoverflow.com/questions/54473126/azure-functions-how-to-use-the-multiparthttpservletrequest-class-from-the-de – Lesrac Nov 29 '22 at 09:53
  • @Lesrac Wow, that's tough to do. – ng.newbie Nov 29 '22 at 20:13

0 Answers0