"Invalid request host ::1" means you are testing the code from the same computer and Tableau Server is seeing the IP address as localhost. You'll want to test from a different computer to make sure Tableau Server sees the request as coming through your trusted web server.
Hi Carisa Chang, thanks for your reply. The problem was not with ip address but was with tableau server reindexing. It took me 1 complete day to find out the error. I ran
and then i started receiving ticket.