Make a WCF Service Accept JSON Data from jQuery.AJAX()

后端 未结 2 1717
伪装坚强ぢ
伪装坚强ぢ 2021-01-13 12:49

I have been searching around for hours and trying different things to get this to work. I have tried so many articles on stackoverflow and either I am too stupid to get thin

2条回答
  •  渐次进展
    2021-01-13 13:35

    change this line

    data: {
        name: "Joe"
    }
    

    to

    data: JSON.stringify({name: 'Joe'});
    

    EDIT:

    Do this to your service. Add WebHttp binding in the config.

     
      
        
          
        
      
    
    

    Hope you know where to add this. If not let me know and I will try to provide some inputs.

    EDIT:

    Following up on my comment,

    
          
    
    
    
        
        
      
    

提交回复
热议问题