Andy -
Yes, Im referring to the PUT and POST methods, in which case the
processor just sends the entire flowfile as a JSON object in the message
body. I'd prefer to either have the option to exclude some of the flow
attributes or (even better) have the ability to craft my own message body.
There are lots of instances where the receiver of the PUT or POST expects a
particular structure that doesn't easily work with just a flat JSON-ified
set of flow attributes.
One example:
We have a flow that has an authentication token as one of the attributes
and a bunch of other key/value pairs used for other purposes. In the
InvokeHTTP processor, I use the auth token attribute in an Authorization
header by creating a dynamic attribute with the correct format
("Authorization: Bearer ${token}"). However, the recipient of the PUT/POST
also expects the body of the request to be formatted a specific way and
does not expect or want to see the auth token or some of the other
unrelated information that ends up getting transmitted as part of the
message body simply because they are flow attributes. So, if InvokeHTTP
were able to exclude certain fields from the message body AND also allow
the body of the message to be configurable into a structure other than just
a flat dictionary of flow attributes, it would be much more powerful and
useful. As it stands, I'm thinking I may have to develop a custom
processor to get past this issue, which is not ideal at all.
Thanks!
Wyllys Ingersoll
On Tue, Jun 18, 2019 at 8:34 PM Andy LoPresto <[email protected]> wrote:
> Hi Wyllys,
>
> Sorry to hear you are having trouble with this processor. Can you please
> provide a more detailed example of an incoming flowfile and what your
> expected output is compared to what is currently happening? Based on my
> understanding, the flowfile attributes are only sent as request headers,
> and that can be controlled using the regular expression value of
> “Attributes to Send”. I believe only the flowfile content is sent as the
> request body when using PUT or POST. Thanks.
>
>
> Andy LoPresto
> [email protected]
> *[email protected] <[email protected]>*
> PGP Fingerprint: 70EC B3E5 98A6 5A3F D3C4 BACE 3C6E F65B 2F7D EF69
>
> On Jun 18, 2019, at 3:01 PM, Wyllys Ingersoll <
> [email protected]> wrote:
>
>
> it would be nice to be able to exclude attributes from the message body
> when doing a PUT or POST in the invokeHTTP processor. Currently, there's
> no way to selectively choose which attributes go into the message body
> without using a replaceText processor in front of it, but that completely
> removes those attributes from being used later which is not always the
> desirable.
>
> There are lots of situations where it would be nice to be able to use some
> flow attributes just in the request header or for other parts of the
> processor configuration without including them in the message body itself.
> For example, taking an authentication token that is carried along as a flow
> attribute so it can be used in an authorization header and NOT included in
> the body of the request.
>
> In general, invokeHTTP needs to allow for more control over the format and
> content of the message body being sent.
>
> -Wyllys Ingersoll
>
>
>