on master help sign in
Minor corrections to the ‘README.md’
2d35928mrkkrp
README.md+13−11
@@ -108,22 +108,24 @@ Then there is Wreq.
108not very good, as there may be new methods, like PATCH which is not new but
108not very good, as there may be new methods, like PATCH which is not new but
109still missing (well you have `customMethod`, but what is the point of having
109still missing (well you have `customMethod`, but what is the point of having
110per-method functions if you have a more general way to use any method? you
110per-method functions if you have a more general way to use any method? you
111−should be able just to insert methods in the “argument slot” of
111+should be able to just insert methods in the “argument slot” of
112`customMethod` and end up with a more general solution). Now every method
112`customMethod` and end up with a more general solution). Now every method
113function has a companion that takes `Options` (like you have `get` and
113function has a companion that takes `Options` (like you have `get` and
114`getWith`). Why the duplication? Where is generality and flexibility? This
114`getWith`). Why the duplication? Where is generality and flexibility? This
115is not all though, because you cannot really use `get` you see in the main
115is not all though, because you cannot really use `get` you see in the main
116module, because you want to have connection sharing. Wreq's author does not
116module, because you want to have connection sharing. Wreq's author does not
117−take the gift `Manager` from `http-client` provides, no, too simple, it
117+take the gift of automatic connection re-use `Manager` from `http-client`
118−invents the whole new thing of “sessions”. Only inside a session your
118+provides, it invents the whole new thing of “sessions”. Only inside a
119−connections will be shared and re-used. However with the session stuff you
119+session your connections will be shared and re-used. However with the
120−have yet another set of per-method functions like `get` and `getWith` —
120+session stuff you have yet another set of per-method functions like `get`
121−these are different ones, to be used with sessions! Now if you have
121+and `getWith` — these are different ones, to be used with sessions! Now if
122−multi-threaded app, here is a surprise for you: you can't share connections
122+you have multi-threaded app, here is a surprise for you: you can't share
123−between threads as connections are shared only inside `withSession` friend
123+connections between threads as connections are shared only inside
124−and “session will no longer be valid after that function returns”.
124+`withSession` friend and “session will no longer be valid after that
125−Disclaimer: I mostly don't use Wreq, see below. If something in this
125+function returns”. Disclaimer: I don't use Wreq, see below. If something in
126−paragraph is not correct, please let me know and I'll remove it.
126+this paragraph is not correct, please let me know and I'll remove it. Also
127+there are valid uses for sessions, but the point is that they are too
128+inconvenient for common tasks.
127
129
128It's funny that one client I worked for had to have his own little wrapper
130It's funny that one client I worked for had to have his own little wrapper
129around `http-client` just because he could not possibly use `wreq` and
131around `http-client` just because he could not possibly use `wreq` and