Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-40043

Allow custom values for Content-Type Header in Pipelines

    Details

    • Type: Improvement
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Won't Do
    • Component/s: http-request-plugin
    • Labels:
    • Environment:
      Jenkins 2.7.3, http-request 1.8.12
    • Similar Issues:

      Description

      When I use the http-request plugin in a pipeline, the page https://jenkins.io/doc/pipeline/steps/http_request/ lists the possible values for the optional headers contentType and acceptType.

      The fixed list of (very few) types is not very helpful, because there is (for example) no value for XML data (text/xml or application/xml). In addition the content-type cannot contain any charset information when it contains only the mime-type.

      I would like to set a content-type like text/xml; charset=UTF-8 which is currently only possible by using the customHeaders parameter.

      It would probably be better to allow any string as contentType. There are so many mime-types and charsets available, I don't think this can be limited to an Enumeration.

        Attachments

          Activity

          Hide
          burki Stephan Burkard added a comment -

          I changed the ticket text and priority since I can set a custom Content-Type via the customHeaders parameter.

          Show
          burki Stephan Burkard added a comment - I changed the ticket text and priority since I can set a custom Content-Type via the customHeaders parameter.
          Hide
          janario Janario Oliveira added a comment -

          I plan to deprecate 'acceptType', 'contentType' in favor to use headers.

          It's bad to have 2 configuration that do the same, and one of it very limited.

           

          Also it could generate duplicated headers from both.

           

          But I plan to do it keeping compatibility.

           

          Show
          janario Janario Oliveira added a comment - I plan to deprecate 'acceptType', 'contentType' in favor to use headers. It's bad to have 2 configuration that do the same, and one of it very limited.   Also it could generate duplicated headers from both.   But I plan to do it keeping compatibility.  
          Hide
          janario Janario Oliveira added a comment -

          Plan to deprecate (acceptType, contentType) and use headers instead.

          I'll see if I can use components with autocomplete for suggestions of headers.

          Show
          janario Janario Oliveira added a comment - Plan to deprecate (acceptType, contentType) and use headers instead. I'll see if I can use components with autocomplete for suggestions of headers.

            People

            • Assignee:
              janario Janario Oliveira
              Reporter:
              burki Stephan Burkard
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: