Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-8323

CXF along with Spring boot Multipart request fails with 400

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Information Provided
    • 3.1.16
    • 3.1.16
    • Core
    • None
    • Unknown

    Description

      I am using spring boot along with Apache CXF. My REST API definition looks as below

       

      @PUT
      @Consumes(value = {MediaType.MULTIPART_FORM_DATA})
      @ApiOperation(value = "Sends a notification")
      public boolean sendNotificationPut(
      @FormParam(QueryParams.SUBJECT) String subject,
      @FormParam(QueryParams.MESSAGE) String message) {

      }

       

      ---------------------------------------------------------------------------

       

      When we hit via REST client, we are always getting 400.

       

      > PUT /rest/notifications HTTP/1.1
      > Host: localhost:9080
      > User-Agent: insomnia/2020.3.3
      > Content-Type: multipart/form-data; boundary=X-INSOMNIA-BOUNDARY
      > Accept: /
      > Content-Length: 231

      --X-INSOMNIA-BOUNDARY
      Content-Disposition: form-data; name="subject"
      A new topic has been created
      --X-INSOMNIA-BOUNDARY
      Content-Disposition: form-data; name="message"
      A new topic has been created
      --X-INSOMNIA-BOUNDARY--
      • We are completely uploaded and fine
      • Mark bundle as not supporting multiuse

      < HTTP/1.1 400
      < Content-Encoding: UTF-8
      < Date: Tue, 04 Aug 2020 05:08:42 GMT
      < Content-Type: text/plain
      < Content-Length: 50
      < Connection: close

      Attachments

        Activity

          People

            Unassigned Unassigned
            arulprakas Arul
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: