Home  >  Article  >  Backend Development  >  PHP获取request payload(在header中)的方法

PHP获取request payload(在header中)的方法

WBOY
WBOYOriginal
2016-06-23 13:17:282934browse

在ajax请求后,怎么也获取不到post数据,用request也不能取到。最后查看一下控制台,发现参数都是在request payload下,难怪。下面解决办法:

file_get_contents( "php://input")

不过,我还是建议,如果不是特殊要求,还是正常的POST吧。

保健食品注册咨询专家

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:PHP水平自测评定Next article:PHP pthreads学习笔记