Closed barocsi closed 7 years ago
Yes, I incorrectly overriden requestOptions.body
and requestOptions.method
.
Should be fixed now in version 1.2.3 (here in git is branch hotfix/bodyMethodOverride)
Thanks a lot for pointing out these issues.
Ok, I have just discovered the same in around interceptor-service.js line 86
I checked the original Angular Http code here and the behaviour is the same: If the first parameter is a Request
instead of an url (string
), then the options
parameter is ignored, because the Request object already has all options.
To keep consitency with the vanilla Http
service I will keep it like that.
Nope. The code below indicates that request.body is not being passed. So the problem is not the concept but the implementation.
InterceptorService.prototype.request = function (url, options) {
options = options || {};
var responseObservable;
if (typeof url === 'string') {
responseObservable = this.httpRequest({
url: url,
options: options,
interceptorOptions: options.interceptorOptions || {}
});
}
else if (url instanceof http_1.Request) {
var request = url;
responseObservable = this.httpRequest({
url: request.url,
options: {
method: request.method,
headers: request.headers,
url: request.url,
withCredentials: request.withCredentials,
responseType: request.responseType
},
interceptorOptions: options.interceptorOptions || {}
});
}
else {
throw new Error('First argument must be a url string or Request instance.');
}
return responseObservable;
};
My bad, that's true, I'll fix that. Edit: Updated. Try again with 1.2.4?
Works!
With this module my JSON Body is stripped out from request using
easy to reproduce, the original Angular 2 http provider works.