Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-10633

json dataformat should set a header "Content-Type: application/json" if there's no "Content-Type" header set

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.19.0
    • Component/s: None
    • Labels:
      None
    • Estimated Complexity:
      Unknown

      Description

      if you marshal to json then send to a HTTP endpoint you'll be missing the fact that the payload is now in JSON format. It seems a reasonable default to add this - so that a HTTP endpoint can know it can parse the payload as JSON.

      e.g.

      from("activemq:foo.bar").
        to("dataformat:json-jackson:marshal").
          /// TODO camel should now expose that the content type is json
        to("http://foo.bar/")
      

        Attachments

          Activity

            People

            • Assignee:
              davsclaus Claus Ibsen
              Reporter:
              jstrachan james strachan
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: