Hi,
from reading the documentation and looking at the example projects I am left a bit confused about what the difference is between pathCall and restCall; besides the fact that I can explicitly define the http method in restCall, whereas the http method seems to be determined automagically (based on the ServiceCall parameters) when using pathCall.
E.g. the chirper example has:
ServiceCall<String, Chirp, NotUsed> addChirp();
...
pathCall("/api/chirps/live/:userId", addChirp()),
and this is called with a HTTP POST from the react-client.
If I understand correctly, one could have also written:
restCall(Method.POST, "/api/chirps/live/:userId", addChirp()),
So I saved a bit of typing but the code is also a bit more obscure because the reader has to deduce that pathCall will be mapped to a POST, based on the ServiceCall having a Request parameter != NotUsed.
Is this "analysis" correct?
Could anyone shed some light on the differences between pathCall and restCall? And when one should prefer one over the other?
Thanks in advance.