Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Nifi InovokeHttp return 405 not allowed

avatar
Explorer

Hi everyone,

I am trying to download some data from url with invokehttp processor on Nifi. This is my configration :

15831-screenshot-14.png

with ${url_to} = https://www.data.gouv.fr/s/resources/elections-presidentielles-1965-2012-1/20150204-183729/cdsp_pres... But the response is :

<html>
<head><title>405 Not Allowed</title><script type="text/javascript" src="http://gc.kis.v2.scr.kaspersky-labs.com/9F89BC97-55F2-F24A-ACA3-16FD48567D73/main.js" charset="UTF-8"></script></head>
<body bgcolor="white">
<center><h1>405 Not Allowed</h1></center>
<hr><center>nginx/1.10.3</center>
</body>
</html>


Do you know why ?

When I try with the command "curl -POST " it works.

2 REPLIES 2

avatar

Hello @Pierre Leroy

I am not sure why POST method is preferable than GET since I don't know about API specification for the HTTP endpoint. Executing "curl -POST " actually does GET request. I believe we have to '-X' to specify HTTP method with curl:

# curl with POST
curl -XPOST -i https://www.data.gouv.fr/s/resources/elections-presidentielles-1965-2012-1/20150204-183729/cdsp_pres...
# Result is the same as you got with NiFi
HTTP/1.1 405 Not Allowed

So, if you'd like to download a CSV from that URL, I'd recommend to use GET HTTP Method instead.

avatar
Rising Star
@Pierre Leroy

when you are referring to download content from the URL, in general GET method is supported to get content from the webservice. I am not sure if you are configuring the POST request wrongly.

"HTTP error 405 method not allowed" means URL exists with webservice but you are not authorized to access/perform that action. Please check if you need to specify any authorization headers to perform the action.

I would suggest to get more details about the URL like uri, http method, is it ssl encrypted, any authorization fields required to access the URL etc and configure the Nifi processor to fulfill the same!