2012-04-25 2 views
1

OData를 JQuery와 함께 사용하고 있습니다. 내 문제는 여기서 Header 값이 필요하므로 Header를 검색해야한다는 것입니다. 당신은 구문을 알고 있니?OData 응답에서 헤더 값 가져 오기

내 코드는 다음과 같습니다 :

 OData.request({headers: { "X-CSRF-Token" :"Fetch" }, requestUri:queryserviceUriNew, user: uname, password: pword }, 
     function (data, response) 
    { 
     //Success Callback (received data is a Feed): 
    alert("Retrieved."); 

    alert(response); 
     // This is the object that hold the response, I need to capture the header value for "x-csrf-token" 

     } 

당신에게 전문가 감사합니다! 경우

답변

1

답을 찾고 다른 사람이있다, 구문은 다음과 같습니다

var에 헤더 _; // 변수 = variable_hold_httpResponse.headers [ 'header_item_that_you_want_to_get']; header_value = response.headers [ 'x-csrf-token'];

건배!