带有标题“HTTP错误400的Jquery Ajax。请求具有无效的标题名称”使用ASP.NET MVC

时间:2015-07-02 12:06:25

标签: jquery ajax asp.net-mvc

我有两个json对象的简单ajax调用,如下所示

[HttpPost]
    [ValidateAntiForgeryTokenOnAllPosts]
    [IsUserAuthorize]
    public JsonResult ManageUserPhoneDetail(Jha.Pps.Portal.Ui.Core.Models.PhoneRegistrationViewModel model)
    {
        JsonResult jsResult = null;
        bool savePhoneRegistrationResult = false;
        savePhoneRegistrationResult = _secondaryAuthenticationController.SavePhoneRegistration(Request.ApplicationPath, CreateSecondaryAuthenticationModel(model.NewModel), CreateSecondaryAuthenticationModel(model.OldModel));
        if (savePhoneRegistrationResult) CurrentUserContext.IsPhoneRegistrationRequired = false;
        var data = new { isSuccess = savePhoneRegistrationResult };
        jsResult = Json(data, JsonRequestBehavior.AllowGet);
        return jsResult;
    }

控制器代码

#include<iostream>
#include<stack>
using namespace std;

bool visited[100];
void intilize(){
    for(int i=0;i<100;i++)
      visited[i]=false;
}
struct node
{
    int data;
    struct node *left,*right;
};
struct node* createNode(int k)
{
    struct node* temp = new node;
    temp->left = NULL;
    temp->right = NULL;
    temp->data = k;
    return temp;
}
stack<node*> s,s1;
void print(){
    while(!s.empty()){
        s1.push(s.top());
        s.pop();
    }
    while(!s1.empty()){
        struct node* a= s1.top();
        cout<<a->data<<" ";
        s1.pop();
        s.push(a);
        if(s1.empty())
        return;

    }


}
void printpath(struct node* node){
    if(node==NULL) return;
    s.push(node);

    while(!s.empty()){
    struct node* top=s.top();
    visited[top->data]=true;

    if(top->left!=NULL&&visited[top->left->data]==false)
     printpath(top->left);
    else if(top->right!=NULL&&visited[top->right->data]==false)
     printpath(top->right);
    else if(top->left==NULL&&top->right==NULL){
    print();
     cout<<"\n";    
    }

     s.pop();   
    }

}


int main() {
    struct node* root = createNode(50);
    root->left = createNode(7);
    root->right = createNode(2);

    root->right->left = createNode(1);
    root->right->right = createNode(30);
    root->right->right->right = createNode(40);
    root->right->left->left = createNode(10);
    root->right->left->left->left = createNode(12);

    intilize();
    printpath(root);

    return 0;
}

获取错误:错误请求 - 标头无效, HTTP错误400.请求具有无效的标头名称

仅当用户第一次登录时才会出现

错误,并且我无法在本地环境中生成相同的错误 任何建议

0 个答案:

没有答案