Get request with string that contains ",jpg"

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • asust9
    New Member
    • Nov 2014
    • 1

    Get request with string that contains ",jpg"

    Hi,

    Have a strange case where I try to make a GET request using jQuery.

    Code:
    $.ajax({
            type: 'GET',
            url: 'MyMethod?param=ABC.ABC',
            timeout: 10000,
            contentType: 'application/x-www-form-urlencoded; charset=UTF-8',        
            success: function (data) {
            },
            error: function (xhr, status, error) {      
            }
        });

    The method above works fine. But if I change the URL to

    'MyMethod?param =ABC.jpg',

    it's not working, the method (MyMethod) never gets called. Could anyone explain this?

    I'm using jQuery 1.9.1
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    it's not working, the method (MyMethod) never gets called.
    does that mean the server script fails or that you don’t even have a request sent?

    Comment

    • Dormilich
      Recognized Expert Expert
      • Aug 2008
      • 8694

      #3
      note: application/x-www-form-urlencoded is an invalid content-type for GET requests.

      Comment

      Working...