Closed sacdallago closed 8 years ago
@sacdallago this idea came up, because it was requested that we provide methods for uploading icons for pokemon, see #72 . From my side it would be a lot easier if they just send us a ZIP and we integrate it into the DB.
Yes. Please do that
Requested icons from PokeMap group.
@sacdallago - Currently, we only have the option of searching by one field in the apis. Example: http://pokedata.c4e3f8c7.svc.dockerapp.io:65014/api/pokemon/id/1 gets the Pokemon with id 1. There is the option to filter by other fields such as type, gender etc.
However, we need to support filtering by multiple parameters.
We would prefer the second approach, but would like to know if there are any other concerns regarding this.
This is an understandable problem.
The standard answer would be no. (No as in GET is to get, POST is to update/create/ eventually delete). I would also be for the no.
I know that in this case the POST would not operate in CUD of CRUD, but still: it is semantically wrong and conceptually misleading.
I am not saying you must not do it, I'm just saying: try to convince me, if you can :D I can convince you that you can't! :D
Would you sacrifice sticking to standards to avoid having long URLs that in most cases are anyway machine generated? Additionally: I don't get the claim:
But this may not be ideal when there are too many parameters and the query string gets too long.
Why wouldn't it be ideal? :). It's the way it is :)
Also: the query
object in express is anyway an object, similar to the body
of a post request, so at the end of the day there's no real huge difference there if you map query attribute to object/schema attribute. You would need to perform validation checks (attribute existence, attribute type,..) on either the body or the query, so again: no difference.
If the concern is the URL length do a boundary test: what is the worst case? URLs can be of 2k char so I guess it's hard to reach even with 20 filter queries :)
If finally the problem is encoding (URL encoding), express does automatic decoding of variables inside the query string (as long as they conform to standards).
GET apis being implemented for search by multiple parameters. Refer #131.
Hey guys,
from the post on GGroups it appears that you want to open up the API to post requests. For me this is a big deal and it changes the API quite a lot... Just to give you a few points:
So I want to ask: how many post/put/delete requests do you think you will need and for what? If it turns out opening to something else then GET is not necessary, I suggest you to let it be :)