Support Questions

Find answers, ask questions, and share your expertise

Access Denied Error with InvokeHTTP

avatar
Expert Contributor

I am using NiFi v.1.16.1

 

When I attempt to retrieve the weather data from the below URL, I don't get any response unless I specify "Always Output Response", and then I get an Access Denied response.  However, these are free data feeds that  work just fine using any other client,

e.g. curl https://w1.weather.gov/xml/current_obs/KSFO.xml

 

Anyone have any ideas what may be going on here?  

1 ACCEPTED SOLUTION

avatar
Super Guru

Hi,

After some research I found in order to avoid getting the 403 error, you need to provide the User-Agent to the header as explained by the FAQ under the same domain (scroll below until you find 403 error):

https://weather-gov.github.io/api/general-faqs

To solve your problem you need to set the UserAgent Property on the invokeHttp processor. It can be something like: nifi/version 1.16.0

Hope that helps, if it does please accept solution.

Thanks

View solution in original post

2 REPLIES 2

avatar
Super Guru

Hi,

After some research I found in order to avoid getting the 403 error, you need to provide the User-Agent to the header as explained by the FAQ under the same domain (scroll below until you find 403 error):

https://weather-gov.github.io/api/general-faqs

To solve your problem you need to set the UserAgent Property on the invokeHttp processor. It can be something like: nifi/version 1.16.0

Hope that helps, if it does please accept solution.

Thanks

avatar
Expert Contributor

Yep!  That is absolutely correct.  Thanks for that.  I spent more time trying to resolve this than I care to admit, because of my bias.  Thanks for this @SAMSAL