AJAX调用时出现Symfony“url not found”错误

I used jQuery in the following code to call a URL and send values by json to that url

$(document).ready(function(){
    $('input#receive_count').click(function(event){            
       var time = $('select#urgent_mail_start_time_year');        
       load({time: time});
    });
    function load(dataParams){
       $.ajax({
          url: '/api/x/shop/receive/get',
          method: 'get',
          datatype: 'json',
          data: dataParams,
          success: function(html){
             alert("in js");
          }
      });
   }
});

In Symfony routing.yml, I have declared this url /api/x/shop/receive/get.:sf_format but it returns an error telling that the url does not match.

Can you suggest a way to solve this?

The ajax is sending to the url /api/x/shop/receive/get but Symfony is expecting /api/x/shop/receive/get.json so it is returning a 404.

Either change the symfony routing to remove .json or change the Ajax URL to /get.json