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

CXF along with Spring boot Multipart request fails with 400

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Information Provided
    • Affects Version/s: 3.1.16
    • Fix Version/s: 3.1.16
    • Component/s: Core
    • Labels:
      None
    • Estimated Complexity:
      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

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

              Dates

              • Created:
                Updated:
                Resolved: