title: Spring-Boot : 400 Bad request error even when parameter is present
body: <p>In the following method there are two parameters <code>childFile</code> and <code>file</code>, I run this call through postman but it gives me 400 Bad Request error when I check the logs it says that parameter <code>childFile</code> is not present, I attach code, error and postman screenshot please tell me what is the issue </p>
  
  <p><a href="https://i.stack.imgur.com/1sTc7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1sTc7.png" alt="Postman Call"></a></p>
  
  <p><strong>Controller</strong></p>
  
  <pre><code>@Transactional
      @RequestMapping(method = RequestMethod.POST, value = "api/addchild",produces="application/json")
      public  ResponseEntity&lt;?&gt; child(Authentication authentication,
              @RequestParam(value="childFile") String childFile, @RequestParam(value="file") MultipartFile file) {
  
          ObjectMapper mapper = new ObjectMapper();
          Child child;
          try {
              child=mapper.readValue(childFile, Child.class);
              Child createdChild=childRepo.save(child);
              if(createdChild!=null)
              {
               childService.createChildPhoto(file, createdChild.getId());
              }
              return ResponseEntity.ok("child created");
          } catch (IOException e1) {
              e1.printStackTrace();
          }
          return ResponseEntity.status(HttpStatus.BAD_REQUEST).body("Child can not be created , please check your headers and string body again.");   
      }
  </code></pre>
  
  <p><strong>Logs</strong></p>
  
  <pre><code>Content-Disposition: form-data; name] with value ["childFile"
  
  {
             "id": 0,
                    "firstName": "Abeer",
                  "lastName": "Hashmi",
                  "gender": "Male",
                  "dateOfBirth": "1999-02-11",
                  "detail": null,
                  "emergencyNumber": "03001111115",
                  "medicalCondition": false,
                  "medicalConditionDescription": null,
                  "enabled": true
  }
  
  ------WebKitFormBoundary3t9AJTMgmU7MV4da
  Content-Disposition: form-data; name="file"; filename="child3.jpg"
  Content-Type: image/jpeg
  [![org.springframework.web.bind.MissingServletRequestParameterException: Required String parameter 'childFile' is not present
      at org.springframework.web.method.annotation.RequestParamMethodArgumentResolver.handleMissingValue(RequestParamMethodArgumentResolver.java:198) ~\[spring-web-4.3.13.RELEASE.jar:4.3.13.RELEASE\]
      at org.springframework.web.method.annotation.AbstractNamedValueMethodArgumentResolver.resolveArgument(AbstractNamedValueMethodArgumentResolver.java:109) ~\[spring-web-4.3.13.RELEASE.jar:4.3.13.RELEASE\]
      at org.springframework.web.method.support.HandlerMethodArgumentResolverComposite.resolveArgument(HandlerMethodArgumentResolverComposite.java:121) ~\[spring-web-4.3.13.RELEASE.jar:4.3.13.RELEASE\]
      at org.springframework.web.method.support.InvocableHandlerMethod.getMethodArgumentValues(InvocableHandlerMethod.java:158) \[spring-web-4.3.13.RELEASE.jar:4.3.13.RELEASE\]
      at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:128) \[spring-web-4.3.13.RELEASE.jar:4.3.13.RELEASE\]
      at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:97) \[spring-webmvc-4.3.13.RELEASE.jar:4.3.13.RELEASE\]
      at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827) \[spring-webmvc-4.3.13.RELEASE.jar:4.3.13.RELEASE\]
      at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738) \[spring-webmvc-4.3.13.RELEASE.jar:4.3.13.RELEASE\]
      at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85) \[spring-webmvc-4.3.13.RELEASE.jar:4.3.13.RELEASE\]
      at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:967) \[spring-webmvc-4.3.13.RELEASE.jar:4.3.13.RELEASE\]
      at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:901) \[spring-webmvc-4.3.13.RELEASE.jar:4.3.13.RELEASE\]
      at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970) \[spring-webmvc-4.3.13.RELEASE.jar:4.3.13.RELEASE\]
      at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872) \[spring-webmvc-4.3.13.RELEASE.jar:4.3.13.RELEASE\]
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:661) \[tomcat-embed-core-8.5.23.jar:8.5.23\]
      at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846) \[spring-webmvc-4.3.13.RELEASE.jar:4.3.13.RELEASE\]
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:742) \[tomcat-embed-core-8.5.23.jar:8.5.23\]
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) \[tomcat-embed-core-8.5.23.jar:8.5.23\]
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) \[tomcat-embed-core-8.5.23.jar:8.5.23\]
      at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) \[tomcat-embed-websocket-8.5.23.jar:8.5.23\]
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) \[tomcat-embed-core-8.5.23.jar:8.5.23\]
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) \[tomcat-embed-core-8.5.23.jar:8.5.23\]
      at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:317) \[spring-security-web-4.2.3.RELEASE.jar:4.2.3.RELEASE\]
      at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:127) \[spring-security-web-4.2.3.RELEASE.jar:4.2.3.RELEASE\]
      at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:91) \[spring-security-web-4.2.3.RELEASE.jar:4.2.3.RELEASE\]][1]][1]
  </code></pre>