angular-odata-es5
angular-odata-es5 copied to clipboard
Params in DefaultRequestOptions missing in request.
In my application I am using this library to request some resources through odata endpoints. I configured the library by injecting my own config:
@Injectable()
class ODataConfig extends ODataConfiguration {
baseUrl = "https://localhost:44364/";
defaultRequestOptions = Object.assign(this.defaultRequestOptions,
{
params: new HttpParams().set('api-version', "1.0"),
headers: new HttpHeaders().set("test", "test")
});
}
This config is working as it picks up the baseUrl and the headers. Unfortunately, if I request data through the ODataService<T> it is missing the HttpParams I added to the defaultRequestOptions.
I am sending a request with the following line (where odata is of type ODataService<T>) :
this.odata.Query().Exec()
Am I missing something here? Thanks!
Hi In my case, I'm consuming SAP Odata Services and I need to send x-csrf token with a post request How can I handle it?