curl uses POST for all requests after redirect
Problem: You are telling curl to do that with your use of -X POST. As the man page section for -X explains this:
The method string you set with -X, --request will be used for all requests, whichif you for example use -L, --location may cause unintended side-effects when curldoesn't change request method according to the HTTP 30x response codes - andsimilar.
Fix: Remove the -X POST from your command line. Use -d "" instead to send an empty post that will adjust accordingly to the proper method after redirect.
More: Explanation and rant in my blog post unnecessary use of curl -X.