Closed thg303 closed 5 years ago
I’ve been thinking about it so far and currenly I want to change the request method to GET for all endpoints that return data and do not perform any actions (like in REST).
The reason for using the POST method was the desire to use JSON to pass parameters, because it allows to preserve parameter types for numeric and boolean values, in contrast to URL-encoded.
well, I don't know what kind of language do you want to use to parse the requests, but it shouldn't matter. Most nowadays languages (frameworks) can cast variables and convert them to a hashtable or similar structures. btw, API should make sense. since it's a communication mechanism for anybody who likes to use the service. I believe it's not a good idea to break general conventions just to make internal code easier to write or maintain.
I think both sides have a valid point but a slight misunderstanding of the final goal of the API. From what I can imagine, an end user of the API such as myself would only ever need the GET to be able to get data from the API. The API's only purpose is to provide easy access to data. It is not meant to allow me to modify the API so any POST, PUT, PATCH are unnecessary for me entirely. These methods should be reserved for internal use for example using the POST to upload a new translation.
Also if the API has not been built yet, might I suggest GraphQL.
I don't know what kind of language do you want to use to parse the requests
We are using PHP and Laravel :)
I believe it's not a good idea to break general conventions just to make internal code easier to write or maintain.
Sure. The main goal is not to make the code easier but just so that parameter types are passed unambiguously.
So, as I said, we will change the method to GET, in shaa Allah.
might I suggest GraphQL
I think this overcomplication, because we don't have so complex queries. To use the current API you need just make an HTTP-request, that the most developers can do, but in case with GraphQL you have to learn what's it, use libraries and so on.
@thg303 can we close this pull request?
So, as I said, we will change the method to GET, in shaa Allah.
It's up to you bro ;-)
@thg303 done
thank you @Imangazaliev