Answer the question
In order to leave comments, you need to log in
Strange behavior of HttpURLConnection, how to understand?
Good afternoon!
In my program, I download files from the server using HttpURLConnection.
Until a certain point, when I changed the file permissions on the server to 777, everything worked ok. But after HttpURLConnection began to issue code 405, and the message was "Not Alowed".
As far as I understand the rights 777 give the exclusive right to do with the files everything and everything you want? But it's not.
After changing the rights to 744, the files began to be downloaded.
How to understand it?
I couldn't find anything similar on google.
Help me figure it out :)
Thank you!
Answer the question
In order to leave comments, you need to log in
HTTP 405 - Method Not Allowed.
It has nothing to do with file permissions. More like setting up a web server.
Such an error occurs if, for example, only POST requests are allowed on the server (or to a specific url), and you are trying to send a GET there.
Or, for example, the OPTIONS (or HEAD) method is used, and only GET and POST are allowed on the server.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question