Search code examples
javascriptjqueryrestful-url

HTTP 414 - RESTful and GET


Im trying to send a large amount of data using a GET request which is naturally leading to the HTTP 414 URI too long error. The RESTful server I am communicating with is not under my control and I can therefor not send it it via POST as the server will not allow this.

Is there any way around this such that I can still send the same amount of data over in a GET request?


Solution

  • Kieran, the answer is no. GET method, as per HTTP standard, does not allow a body as part of the request. You only have the URI to pass data. You're going to need to break your request into a series of smaller requests and group your results afterwards. You'll need to approach this problem with it's asynchronous nature in mind - you might want to look into promises to help you ensure that you've gathered all the results from a series of requests.