title: How to pass body @RequestBody and @RequestParam in same request
body: <p>I'm trying to pass a body and a param in the same request using the package 
  <a href="https://pub.flutter-io.cn/packages/dio" rel="nofollow noreferrer">dio</a>.</p>
  
  <p>I have this method on Spring boot:</p>
  
  <pre><code>@PostMapping("/guardarproducto")
      public ResponseEntity&lt;Usuario&gt; insertProduct(@RequestBody String body, @RequestParam("imagen") MultipartFile imagen) {
   ....
  }
  
  </code></pre>
  
  <p>I've tried to do this request with:</p>
  
  <pre><code>FormData formData = new FormData.from({
          "barcode": barcode != null ? this.barcode : null,
          "idUsuario": user.id,
          "nombre": _textController.text,
          "aditivos": aditivosLeidos,
          "imagen": pickedImage
        });
        await dio.post('https://10.0.2.2:8443/api/guardarproducto',
            data: formData);
  </code></pre>
  
  <p>But i get:</p>
  
  <pre><code>{
      "timestamp": "2019-07-03T12:11:39.902+0000",
      "status": 400,
      "error": "Bad Request",
      "message": "Required request body is missing: public org.springframework.http.ResponseEntity&lt;ual.dra.rest.Usuario&gt; ual.dra.rest.AditivoController.insertProduct(java.lang.String,org.springframework.web.multipart.MultipartFile)",
      "path": "/api/guardarproducto"
  }
  </code></pre>
  
  <p>How can i pass body and request param in the same request?</p>
  
  <p>I don't care use Dio or Http package.</p>