title: Passing a complex FormData from angular 5 to Java Spring 3
body: <p>I'm trying to insert into a FormData an array of arrays and a string, however java seems to not receive it , I have no log error in my Java server however I have a 500 Internal Server Error in my JavaScript console.</p>
  
  <p>Here is the code for my controller :</p>
  
  <pre><code> @RequestMapping(value = "/getReporting", method = RequestMethod.POST)
    @ResponseBody
    public void  getReporting(@RequestParam RecommendationForm form, @RequestParam String type, HttpServletResponse response) throws ApcException {
  
      System.out.println("prova");
      Map.Entry&lt;String, byte[]&gt; result =  this.reportingService.getReporting(form,type);
  
      try {
        response.setHeader(//
          "Content-Disposition",//
          "attachment; filename=" +"bobo.xlsx");
        response.setContentType("Application/x");
        response.getOutputStream().write(result.getValue());
        response.flushBuffer();
      } catch (IOException e) {
  
        e.printStackTrace();
      }
  
    }
  }
  </code></pre>
  
  <p>And here is my service in Angular :</p>
  
  <pre><code> public getExcel(form: FormData): Observable&lt;HttpResponse&lt;Blob&gt;&gt; {
  
      return this.http.post('/SV-AUD/api/reporting/getReporting', form, {observe: 'response', responseType: 'blob'});
    }
  </code></pre>
  
  <p>And the component where I append the info in the formData :</p>
  
  <pre><code>form: FormGroup = this._fb.group(
      {
        hello1: [],
        hello2: [],
        hello3: [],
        hello4: [],
        hello5: [],
        hello6: [],
        hello7: [],
        hello8: [],
        hello9: [],
      }
    );
  
  exportExcel() {
  
      const formData: FormData = new FormData();
      formData.append('form', this.form.getRawValue());
  
      if (this.detailedType) {
        formData.append('type', 'detailed');
      } else {
        formData.append('type', 'list');
      }
      this.reportingService.getExcel(formData).subscribe(data =&gt; {
        const ctHeader = data.headers.get('content-disposition');
        if (ctHeader) {
          const filename = ctHeader.split('=')[1];
          saveAs(data.body, filename);
        }
      });
  
    }
  </code></pre>