You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think the HttpClient.request getter is an awkward way to create a new request. The getter makes it look like it's mutating the client's state, or something. I think the API would be considerably clearer if it were a method instead.
This change replaces the `HttpClient.request` getter with an `HttpClient.createRequest()` method to clarify the API for creating new HTTP requests.
Fixesaurelia#27
bryanrsmith
added a commit
to bryanrsmith/http-client
that referenced
this issue
Mar 21, 2015
This change replaces the `HttpClient.request` getter with an `HttpClient.createRequest()` method to clarify the API for creating new HTTP requests.
This is a breaking API change. To update, replace uses of the `HttpClient.request` property with calls to the `HttpClient.createRequest()` method.
Fixesaurelia#27
createRequest obviously looks like a factory method, like you are building a new request instance which is more clear incase you are always creating a new instance and never reusing one. In that case you might as well aloe the params hash to be passed directly as an argument to the factory method.
I think the
HttpClient.request
getter is an awkward way to create a new request. The getter makes it look like it's mutating the client's state, or something. I think the API would be considerably clearer if it were a method instead.Current API:
Proposed API:
The text was updated successfully, but these errors were encountered: