[英]How can I solve Trying to get property of non-object?
$data = file_get_contents("php://input");
if (isset($data)) {
$request = json_decode($data);
$un = $request->username;
$mob = $request->mobile;
$em = $request->email;
}
The reason this error is happening is because the HTTP request does not contain a JSON object with with your expected properties.发生此错误的原因是 HTTP 请求不包含具有您预期属性的 JSON 对象。 For example, if you are getting the error when grabbing the username, it means that your JSON object does not have a username
property.例如,如果您在抓取用户名时遇到错误,则表示您的 JSON 对象没有username
属性。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.