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

Allow custom values for Content-Type Header in Pipelines

    • Icon: Improvement Improvement
    • Resolution: Won't Do
    • Icon: Minor Minor
    • http-request-plugin
    • Jenkins 2.7.3, http-request 1.8.12

      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.

          [JENKINS-40043] Allow custom values for Content-Type Header in Pipelines

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

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

          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.

           

          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.  

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

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

          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.

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

              Created:
              Updated:
              Resolved: