That's an interesting service, must expect smallish files :) You can
get the entire content into an attribute using ExtractText, match the
whole thing and put it in an attribute called "file", then set the
Attributes To Send property in InvokeHttp to include "file" and
anything else (except Content-Type, that's its own property).  If you
need to get the content of /home/nifi/test/dummyfilename.txt, you can
use FetchFile before the ExtractText, just give it a flow file
containing two attributes: "absolute.path" set to "/home/nifi/test/",
and "filename" set to "dummyfilename.txt".

Regards,
Matt

On Wed, Nov 8, 2017 at 11:12 AM, James McMahon <jsmcmah...@gmail.com> wrote:
> The service I am calling expects the content to be in an http post attribute
> called "file". Using the guidance from you above Matt (thanks very much for
> that), I have been able to post in attribute "file" some random text,
> "@/home/nifi/test/dummyfilename.txt". I see that as output from a ListenTTP
> processor, so I have confirmed that I do get that. The last piece of the
> puzzle is to set that attribute to be the flowfile content. How do I set
> that attribute to be my flowfile content?
>
> The challenge I seem to be having is that the service is not a nifi flow.
> How do i feed to it the content body?
>
> On Wed, Nov 8, 2017 at 9:41 AM, Matt Burgess <mattyb...@apache.org> wrote:
>>
>> Jim,
>>
>> The content of the flow file is the body of the outgoing POST, so you
>> could query provenance for the PostHttp processor, find the associated
>> flow file(s), and (if the content is still available in the content
>> repository) retrieve the content. Also the resolved URL for the POST
>> (after evaluating Expression Language, e.g.) is available in the
>> provenance event. This can all be done using the REST API. If you
>> don't need to review the contents "online", you can place a PutFile or
>> LogAttribute before the PostHttp, and effectively "download" the flow
>> file content as it will be presented to the PostHttp processor.
>>
>> Regards,
>> Matt
>>
>>
>> On Wed, Nov 8, 2017 at 9:08 AM, James McMahon <jsmcmah...@gmail.com>
>> wrote:
>> > But isn't the Http response what comes back to us? I like your thinking,
>> > but
>> > it is the outgoing post i need to review. The response won't help me
>> > with
>> > that. Am I missing the point?
>> >
>> > On Wed, Nov 8, 2017 at 8:52 AM, Mike Thomsen <mikerthom...@gmail.com>
>> > wrote:
>> >>
>> >> Don't know, but you might want to try out InvokeHttp. I know it lets
>> >> you
>> >> tap into the output if you tell it to always output the HTTP response.
>> >>
>> >> On Wed, Nov 8, 2017 at 8:28 AM, James McMahon <jsmcmah...@gmail.com>
>> >> wrote:
>> >>>
>> >>> How can we tap into the workflow to see the output of the PostHTTP
>> >>> processor? What are options folks have used to do that?
>> >>>
>> >>> Thanks in advance. -Jim
>> >>
>> >>
>> >
>
>

Reply via email to