Search code examples
ajaxgetrequestparse-platform

GET Request - Why is my URI so long?


I'm making a GET request using the PARSE API. I'm getting a "414 Request-URI Too Large" error, but I don't understand why. Here is the code for my request:

 $.ajax({ 
      url : 'https://api.parse.com/1/classes/chats',
      type : 'GET',
      dataType: 'json',
      data : JSON.stringify({   
        order: '-createdAt',    
      }),
      success : function(data) {
        handleData(data)
      },
      error : function(data) {
        console.log('error: ' + data);
      }
    });

Solution

  • Because the server says so, e.g. the service you're querying against is so configured. From Wikipedia

    414 Request-URI Too Long The URI provided was too long for the server to process - The HTTP/1.1 Specification. Often the result of too much data being encoded as a query-string of a GET request, in which case it should be converted to a POST request.