You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@nifi.apache.org by Chris Mangold <cs...@gmail.com> on 2015/03/19 04:40:31 UTC

Newbie question about NIFI using InvokeHTTP

I could not find a user subscriber list so if my email needs to be directed
else where please let me know.

I am trying to use NIFI to crack open a file of text and forward the
content to a REST service that Natural Language Processing REST endpoint.

I use GetFile processor to read the content and send it on to InvokeHTTP
process. Request goes out but I receive a "415 unsupported media type"
error.  Is there a way I can change the content-header to
application/text.or do I need to change the format using CompressContent.

Maybe I need to write a custom Processor.

Thanks for your help.

Chris

Newbie question about NIFI using InvokeHTTP

Posted by Chris Mangold <cs...@gmail.com>.
Thanks for your Response Joe that was a big help got me over the hump.

On Wed, Mar 18, 2015 at 11:55 PM, Joe Witt <joe.witt@gmail.com
<javascript:_e(%7B%7D,'cvml','joe.witt@gmail.com');>> wrote:

> Hello Chris,
>
> You could put an UpdateAttribute processor in between GetFile and
> InvokeHttp.  In that processor just add an attribute called
> 'Content-Type' with a value of 'application/text'.  On the InvokeHttp
> processor just make sure you specify the attribute 'Attributes to
> Send' and provide a regex that includes your Content-Type attribute.
>
> You certainly can use CompressContent if you need to have the data
> compressed or decompressed.  But sounds like that might not be needed
> here.
>
> To get a really good understanding of the attributes on the flow file
> that NiFi knew when the data entered InvokeHttp you can utilize the
> provenance feature.  A bit more documentation about that can be found
> here [1].  With that capability you can pretty much walk through the
> flow and see what it looks like at each stage.  With the 0.1.0 release
> we plan to include a stock content viewer too so that will allow you
> to even see exactly what the content was.
>
> [1]
> http://nifi.incubator.apache.org/docs/nifi-docs/user-guide.html#data-provenance
>
> ...we don't yet have a user alias so you came to the right place.
> Feel free to ask questions as much as you need.  And if there are
> things that seem more complicated than they should be please let us
> know.
>
> Thanks
> Joe
>
> On Wed, Mar 18, 2015 at 11:40 PM, Chris Mangold <csm9105@gmail.com
> <javascript:_e(%7B%7D,'cvml','csm9105@gmail.com');>> wrote:
> > I could not find a user subscriber list so if my email needs to be
> directed
> > else where please let me know.
> >
> > I am trying to use NIFI to crack open a file of text and forward the
> > content to a REST service that Natural Language Processing REST endpoint.
> >
> > I use GetFile processor to read the content and send it on to InvokeHTTP
> > process. Request goes out but I receive a "415 unsupported media type"
> > error.  Is there a way I can change the content-header to
> > application/text.or do I need to change the format using CompressContent.
> >
> > Maybe I need to write a custom Processor.
> >
> > Thanks for your help.
> >
> > Chris
>



-- 
Chris Mangold
301-471-5758 (c)
301-898-7979 (h)


-- 
Chris Mangold
301-471-5758 (c)
301-898-7979 (h)

Re: Newbie question about NIFI using InvokeHTTP

Posted by Joe Witt <jo...@gmail.com>.
Hello Chris,

You could put an UpdateAttribute processor in between GetFile and
InvokeHttp.  In that processor just add an attribute called
'Content-Type' with a value of 'application/text'.  On the InvokeHttp
processor just make sure you specify the attribute 'Attributes to
Send' and provide a regex that includes your Content-Type attribute.

You certainly can use CompressContent if you need to have the data
compressed or decompressed.  But sounds like that might not be needed
here.

To get a really good understanding of the attributes on the flow file
that NiFi knew when the data entered InvokeHttp you can utilize the
provenance feature.  A bit more documentation about that can be found
here [1].  With that capability you can pretty much walk through the
flow and see what it looks like at each stage.  With the 0.1.0 release
we plan to include a stock content viewer too so that will allow you
to even see exactly what the content was.

[1] http://nifi.incubator.apache.org/docs/nifi-docs/user-guide.html#data-provenance

...we don't yet have a user alias so you came to the right place.
Feel free to ask questions as much as you need.  And if there are
things that seem more complicated than they should be please let us
know.

Thanks
Joe

On Wed, Mar 18, 2015 at 11:40 PM, Chris Mangold <cs...@gmail.com> wrote:
> I could not find a user subscriber list so if my email needs to be directed
> else where please let me know.
>
> I am trying to use NIFI to crack open a file of text and forward the
> content to a REST service that Natural Language Processing REST endpoint.
>
> I use GetFile processor to read the content and send it on to InvokeHTTP
> process. Request goes out but I receive a "415 unsupported media type"
> error.  Is there a way I can change the content-header to
> application/text.or do I need to change the format using CompressContent.
>
> Maybe I need to write a custom Processor.
>
> Thanks for your help.
>
> Chris