CrowdHailer / raxx

Interface for HTTP webservers, frameworks and clients
https://hexdocs.pm/raxx
Apache License 2.0
402 stars 29 forks source link

can we call set_query multiple times to add / change query params on the request #64

Closed CharlesOkwuagwu closed 6 years ago

CharlesOkwuagwu commented 6 years ago

This line will only match requests where the query had not been set

def set_query(request = %Raxx.Request{query: nil}, query) do

What if we want to set / append / or change the existing query?

CrowdHailer commented 6 years ago

I'm trying to make my helpers more restrictive than not. as a starting point. This point is one I think is interesting but counterpoints that I have thought of. a) this will catch if anyone mistakenly sets query twice b) There is ambiguity on how you might merge queries d) the user can always fall back to %{request | query: query} if they really need it.

CharlesOkwuagwu commented 6 years ago

a) this will catch if anyone mistakenly sets query twice

Then we make this explicit in the docs for that function, that clears the ambiguity

CrowdHailer commented 6 years ago

Are you able to add a comment in the docs that makes this clear to you?

CharlesOkwuagwu commented 6 years ago

i'll think of one