저는 AngularJS에 처음 왔으며, Headless Drupal 인터페이스를 만드는 데이 작업을 사용하고 있습니다. 검색 한 후RESTful 서비스를 통해 콘텐츠를 만드는 헤드리스 Drupal
//test function
$scope.test = function() {
console.log("NODE Test function responding!");
var user_session = $cookieStore.get('user_session');
console.log(user_session);
var nodeObj = {
"title": "Node Test",
"body": "Node body contents test#2",
"type": "page"
};
var nodeObj = {
"type": "page",
"title": "New Page",
"language": "und"
};
var res = $http.post("http://mydrupal-services-site/angularjs-headless/api/v1/node", nodeObj, {
"headers": user_session
});
res.success(function(data, status, headers, config) {
$scope.message = data;
console.log("Success: ");
console.log(data);
});
res.error(function(data, status, headers, config) {
console.error(data);
});
}
, 내가 LimitRequestFieldSize 16384
를 추가 제안 게시물을 발견 : 여기
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>400 Bad Request</title>
</head><body>
<h1>Bad Request</h1>
<p>Your browser sent a request that this server could not understand.<br />
The number of request header fields exceeds this server's limit.</p>
<hr>
<address>Apache/2.4.7 (Ubuntu) Server at 127.0.0.1 Port 80</address>
</body></html>
내가 사용하고 코드입니다 :
나는 다음과 같은 오류가 발생하는 문제에 충돌했습니다 내 VirtualHost에 문제를 해결할 수 있지만 그것을하지 않았다. 귀하는 기본적으로 헤더에 최대 8킬로바이트을 보낼 수있는
Cookie:SESSb22b2ff3837c37411e0b1da3fbd77b0c=_bwpgljhXPwcA_ZfmZpL2IrnIvo25PX_APYdzrIcM08 X-CSRF-Token:GwXcAwctxVcOi_FvI-Mfm6HYQaLoWAFnvkQQ-Nnzbhs
제 질문에 대한 답변을 확인하십시오. 귀하의 user_session 쿠키가 6028 자 이상이어야합니다. – lin
안녕하세요 @ 린, 내 user_session 데이터는 단지 144 자 길이입니다. 질문에 대한 업데이트로 포함했습니다. – sisko
HTTP 요청에서 보내는 전체 요청 헤더를 추가 할 수 있습니까? (콘솔에서 네트워크 탭의 원시 출력) – lin