nifi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (NIFI-1620) Allow empty Content-Type in InvokeHTTP processor
Date Tue, 22 Mar 2016 02:19:25 GMT

    [ https://issues.apache.org/jira/browse/NIFI-1620?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15205638#comment-15205638
] 

ASF GitHub Bot commented on NIFI-1620:
--------------------------------------

Github user taftster commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/272#discussion_r56928547
  
    --- Diff: nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/InvokeHTTP.java
---
    @@ -215,14 +215,24 @@
                 .build();
     
         public static final PropertyDescriptor PROP_CONTENT_TYPE = new PropertyDescriptor.Builder()
    -        .name("Content-Type")
    -        .description("The Content-Type to specify for when content is being transmitted
through a PUT or POST. "
    -            + "In the case of an empty value after evaluating an expression language
expression, Content-Type defaults to " + DEFAULT_CONTENT_TYPE)
    -        .required(true)
    -        .expressionLanguageSupported(true)
    -        .defaultValue("${" + CoreAttributes.MIME_TYPE.key() + "}")
    -        .addValidator(StandardValidators.NON_EMPTY_VALIDATOR)
    -        .build();
    +            .name("Content-Type")
    +            .description("The Content-Type to specify for when content is being transmitted
through a PUT or POST. "
    +                    + "In the case of an empty value after evaluating an expression language
expression, Content-Type defaults to " + DEFAULT_CONTENT_TYPE + "."
    +                    + "If and only if body is not sent, Content-Type must be set to empty")
    +            .required(false)
    +            .expressionLanguageSupported(true)
    +            .defaultValue("${" + CoreAttributes.MIME_TYPE.key() + "}")
    +            .addValidator(StandardValidators.createAttributeExpressionLanguageValidator(AttributeExpression.ResultType.STRING))
    +            .build();
    +
    +    public static final PropertyDescriptor PROP_SEND_BODY = new PropertyDescriptor.Builder()
    +            .name("Send body")
    +            .description("True if the body content should be sent, false otherwise")
    +            .defaultValue("true")
    --- End diff --
    
    We should refer to this as the HTTP spec refers to it.  It's called the "message-body"
in the spec, so I think we should use that here as well.  i.e.
    
    ```
    .name("send-message-body")
    .displayName("Send Message Body")
    .description("If true, sends the HTTP message body on POST/PUT requests (default).  If
false, suppresses the message body and content-type header for these requests.")
    ```


> Allow empty Content-Type in InvokeHTTP processor
> ------------------------------------------------
>
>                 Key: NIFI-1620
>                 URL: https://issues.apache.org/jira/browse/NIFI-1620
>             Project: Apache NiFi
>          Issue Type: Bug
>          Components: Extensions
>    Affects Versions: 0.5.1
>            Reporter: Pierre Villard
>            Assignee: Pierre Villard
>
> External API could expect a POST request without a Content-Type property or at least
with this property empty:
> *Error example:*
> {quote}
> You provided a non-empty HTTP "Content-Type" header ("application/json").  This API function
requires that the header be missing or empty.
> {quote}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message