the server responded with a status of 405 (Method Not Allowed)

前端 未结 5 1327
夕颜
夕颜 2020-12-30 14:51

I am new to Web Sevice, I am getting the following error when I tried to run my page (Local) in Chrome Console

ERROR

5条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-30 15:12

    make your content type as "application/json; charset=utf-8", as follows

    $(document).ready(function() {
    $.ajax({
    type: "POST",
    url: "RSSReader.asmx/GetRSSReader",
    data: "{}",
    contentType: "application/json; charset=utf-8",
    dataType: "json",
    success: function(msg) {
      // Hide the fake progress indicator graphic.
      $('#RSSContent').removeClass('loading');
    
      // Insert the returned HTML into the 
    . $('#RSSContent').html(msg.d); } }); });

    also refer link

提交回复
热议问题