jQuery Ajax POST call with JSON in Rest Web Service Issue

前端 未结 3 1623
生来不讨喜
生来不讨喜 2021-01-14 22:39

I want to post a JSON object from my page to a Rest WS. But when I am posting json through jQuery ajax call as output I am getting a HTML page with \"HTTP Status 405

3条回答
  •  被撕碎了的回忆
    2021-01-14 22:56

    datatype should be dataType: 'json'

    If you are using contentType: "application/json", , then you should stringify your data.

    data:JSON.stringify(jsonObj), 
    

提交回复
热议问题