doudiyu1639 2018-03-09 13:01
浏览 69

由于URL重定向,我是否获得GET REQUEST而不是POST REQUEST?

I am using Dialogflow to create a chat interface. I have created a webhook from Dialogflow to XAMPP (specifically to http://localhost:8080) to pass some data in json form from Dialogflow to a PHP script so as to process them.

However, my REQUEST METHOD $_SERVER['REQUEST_METHOD'] does not receive a POST REQUEST as it is specified in the form of Dialogflow but a GET REQUEST. In other words, in line $method = $_SERVER['REQUEST_METHOD']; of my source code $method is not 'POST' as it was expected but 'GET'.

From reading posts like the following:

I have the impression that my problem arises because of a URL redirection and specifically because my webhook does not have the exact form that it should have as a URL. For example, if I use the URL http://localhost:8080/htdocs/index.php where index.php is my php script in XAMPP then I am redirected (not-automotically) to http://localhost:8080. Specifically, what appears on my screen is the following:

Object not found!

The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again.

If you think this is a server error, please contact the webmaster.

Error 404

localhost Apache/2.4.29 (Unix) OpenSSL/1.0.2n PHP/7.2.1 mod_perl/2.0.8-dev Perl/v5.16.3

The work 'localhost' has a hyperlink which redirects me to http://localhost:8080 if I press it.

Is URL redirection the problem?

If so, how can I deal with it so that I can receive finally my POST REQUEST?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 数学建模招标中位数问题
    • ¥15 phython路径名过长报错 不知道什么问题
    • ¥15 深度学习中模型转换该怎么实现
    • ¥15 HLs设计手写数字识别程序编译通不过
    • ¥15 Stata外部命令安装问题求帮助!
    • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
    • ¥15 TYPCE母转母,插入认方向
    • ¥15 如何用python向钉钉机器人发送可以放大的图片?
    • ¥15 matlab(相关搜索:紧聚焦)
    • ¥15 基于51单片机的厨房煤气泄露检测报警系统设计