Skip to content

Params in DefaultRequestOptions missing in request. #75

@bkardol

Description

@bkardol

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 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) :
this.odata.Query().Exec()

Am I missing something here?
Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions