Skip to content
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

Merged
merged 9 commits into from
Sep 13, 2016
Merged

Feature/new http #62

merged 9 commits into from
Sep 13, 2016

Conversation

emoralesb05
Copy link
Contributor

@emoralesb05 emoralesb05 commented Sep 11, 2016

Description

Update http module to provide interceptors to be inline on how ngModule works.
#58
#65

What's included?

  • Removed depricated provideInterceptors() method from http module.
  • Fixed bugs in interceptor pipeline where 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.
  • Polished code to be more maintainable in http module.
  • Added NgModule notation and provided interceptors with forRoot(). e.g. CovalentHttpModule.forRoot([InterceptorA, InterceptorB])
  • Updated http docs.
  • Updated README.md with setup.

Test Steps

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)

@emoralesb05 emoralesb05 added this to the Alpha 0.7 milestone Sep 11, 2016
HttpInterceptorService,
],
})
export class CovalentHttpModule {
Copy link
Contributor

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)));
Copy link
Contributor

@ilsiepotamus ilsiepotamus Sep 12, 2016

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.

Copy link
Contributor Author

@emoralesb05 emoralesb05 Sep 12, 2016

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.

Copy link
Contributor

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.

@kyleledbetter kyleledbetter merged commit 91050c5 into develop Sep 13, 2016
@emoralesb05 emoralesb05 deleted the feature/new-http branch September 13, 2016 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants