-
Notifications
You must be signed in to change notification settings - Fork 357
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/new http #62
Feature/new http #62
Conversation
…() to be inline with angular
HttpInterceptorService, | ||
], | ||
}) | ||
export class CovalentHttpModule { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't this class definition be in it's own file? typically i thought index.ts
just described the things being exported from the different services.
}).catch((error: Response) => { | ||
return this._errorResolve(error); | ||
}); | ||
return this._setupRequest(this._http.delete(url, this._requestResolve(options))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HTTP 1.1 allows for a body in a DELETE call- https://tools.ietf.org/html/draft-ietf-httpbis-p2-semantics-19
The most prominent example of this I can think of is elasticsearch passes a body in a DELETE when removing objects.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Problem is that method Http#delete()
in angular doesnt support a body parameter, we are just wrapping that service. Although for those cases, we have the generic request
method that allows to set a method DELETE with body.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe something we take note of and deal with later, esp. since angular doesn't support it.
Description
Update
http
module to provide interceptors to be inline on how ngModule works.#58
#65
What's included?
provideInterceptors()
method fromhttp
module.Response
/RequestOptions
objects passed through the pipeline would not be received at the end stage (success/error), even if the pipeline returned a different object.http
module.NgModule
notation and provided interceptors withforRoot()
. e.g.CovalentHttpModule.forRoot([InterceptorA, InterceptorB])
http
docs.README.md
with setup.Test Steps
ng serve
Note: There is no easy way to test it, since you would have to create a service and interceptors just for the tests and point to a real API. (or mock API)