I am facing a problem within a PHP Restful API ...
I am trying to GET some products informations (weight, process, price ...) by calling this API.
The problem is that the provided URI can contain a lot of characters because we are trying to make as less API calls as possible.
As you can understand, if we send a too long URI using HTTP GET method, I will surely finish with a 414 or 500 HTTP ERROR.
So how can we :
Here is an example of a request :
http://<myWebsite>/rprocess/api/process/{"data":["FLY.DELeco.LOT100.DIM10x10.FACrv.SUPdemma.GRA350.PELbrv.VERss","FLY.DELnor.LOT500.DIM20x30.FACr.SUPcoubr.GRA300.PELbrv.VERss"]}
I have already searched for an answer on this problem but it looks like we can not stay restful in that case.
Here are the answers I have found:
X-HTTP-Method-Override: GET
url limit size
on the server (not recommended)I hope those informations can help you answer my question :)
Thank you for your help
Maybe you could try looking up your data by id if you have a normalised database table to help shorten your request
or you could try POSTing the query to the server, storing the details of the request and then perform a GET request using the ID of the previously stored request