Php Heroku和localhost POST差异
我正在尝试编写一个Flask应用程序,它通过使用requests模块的POST请求合并了一个PHP脚本。我在我发布的本地机器上取得了成功Php Heroku和localhost POST差异,php,python,heroku,Php,Python,Heroku,我正在尝试编写一个Flask应用程序,它通过使用requests模块的POST请求合并了一个PHP脚本。我在我发布的本地机器上取得了成功 requests.post("http://localhost/webapp/templates/script.php", data=blah) 一切如期进行。然而,当我将代码推送到Heroku时,post请求不再有效——相反,我被重定向到 http://mysite/php_post 找一个 Internal Server Error The ser
requests.post("http://localhost/webapp/templates/script.php", data=blah)
一切如期进行。然而,当我将代码推送到Heroku时,post请求不再有效——相反,我被重定向到
http://mysite/php_post
找一个
Internal Server Error
The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.
我猜你想将数据发布到你的heroku应用程序中
requests.post("http://localhost/webapp/templates/script.php", data=blah)
应该是
requests.post("http://mysite/webapp/templates/script.php", data=blah)
我只是试了一下,但没用。我的URL已更改为:并且出现应用程序错误。我尝试过将run设置设置为0.0.0.0或类似的设置,但也没有效果。我对我的文件路径也很有信心,因为我实际上运行了bash命令并进入了文件所在的正确目录。