0

If I send this form to Micronaut with method='GET' then I can extract param1 as a list of two values ... aaa and bbb

<form action='/test/post' method='GET' >
    <input type='hidden' name='param1' value = 'aaa'/>
    <input type='hidden' name='param1' value = 'bbb'/>            
    <input type='submit' value='Post'/> 
</form>

If however I post it and use the method(@Body Map params) and

    consumes=MediaType.APPLICATION_FORM_URLENCODED 

on the server side only the last value ('bbb') is seen. The same is true if I encode with multipart/form-data instead.

Is this a bug or a feature of Micronaut 1.0.0 ?

  • Can you show what the request body is in both of the failure cases? – James Kleeh Nov 09 '18 at 16:26
  • @James - In the x-www-form-urlencoded case it is param1=aaa&param1=bbb and in the multipart/form-data it is ------WebKitFormBoundaryTRQB1iFcEg1bdcMa Content-Disposition: form-data; name="param1" aaa ------WebKitFormBoundaryTRQB1iFcEg1bdcMa Content-Disposition: form-data; name="param1" bbb ------WebKitFormBoundaryTRQB1iFcEg1bdcMa-- – Alan Littleford Nov 09 '18 at 17:36

1 Answers1

1

This is a bug that will be handled in the next release

PR submitted: https://github.com/micronaut-projects/micronaut-core/pull/899

James Kleeh
  • 12,094
  • 5
  • 34
  • 61