Open thlo7777 opened 8 years ago
I found when I post the data to server, postman fill Content-Type: application/json, and I saw it from apache log. But restful parseBody function always get empty content type from getHeaders(), then it will set "application/x-www-form-urlencoded" for content type. I thought might be varnish cause I use apache + varnish + drupal. But it still exists after I disabled varnish
Has anyone can help me to explain it? Many thanks
wrote a log in restful() function in restful.module. Every time manager increase size when received a http request from client. Because manager object has exists, it will not invoke createFromGlobals to check http header again, so can't get Content-Type: application/json. May be something was wrong to invoke parse Content-Type: application/json for old http request.
I compared manager object size after received multiple http requests using same json api, the manager size keep every request result and the object size is increasing. Does anyone know how to clear manger cache or reduce it correctly. Otherwise if server get tens of thousands of requests, how big size about manager?
I use apache 2.4.7 + php-fpm module. May be apache_request_headers can't work for php-fpm
@thlo7777 unfortunately I don't have an environment like that. Would you be able to submit a pull request?
OK, I'll try to explain it as detail as possible
Hi, Guys I want to create an article from mobile to drupal, but restful return:
my restful api is http://dld.dreamland360.com/api/my_articles
post data:
my class is
`/**
namespace Drupal\dld_restful_api\Plugin\resource\node\article\v1;
use Drupal\restful\Plugin\resource\ResourceInterface; use Drupal\restful\Plugin\resource\ResourceNode;
/**
) _/ class MyArticles_10 extends ResourceNode implements ResourceInterface { // TODO: Document the use of the idField. /*
$public_fields['title'] = $public_fields['label']; $public_fields['body'] = array( 'property' => 'body', 'sub_property' => 'value', );
unset($public_fields['label']); unset($public_fields['self']); return $public_fields; } }`
and my drupal log show me
Notice: Undefined property: stdClass::$nid 在 entity_metadata_no_hook_node_access() (行 682 在 /home/www/dld/sites/all/modules/entity/modules/callbacks.inc).
Anyone can give me some clues, thank a lot