Skip to content

[Typescript][Angular] Response headers are not available. #6902

@HermenOtter

Description

@HermenOtter
Description

I want to access the response headers for an E-tag. For my current swagger yaml file, it doesn't generate anything to access it. This is the same issue it is supposedly fixed, but in my current generated code base I cannot find the withHttpInfo methods, are they removed in a newer version? Or am I doing something wrong?
@wing328

Swagger-codegen version

master (commit f78d958 ))

Swagger declaration file content or url
path:
    parameters:
    ............
    get:    
      .............
      produces:
      - "application/json"
      .............
      responses:
        200:          
          headers:
            ETag:
              type: string
          schema:
            ............         
 public get(......params..): Observable<any> {
        if (parm=== null || param=== undefined) {
            throw new Error('error.');
        }
        let headers = this.defaultHeaders;

        return this.httpClient.get<any>(`${this.basePath}...path...}`,
            {
                headers: headers,
                withCredentials: this.configuration.withCredentials,
            }
        );
    }

Suggestion

There is a way to fix it with the new httpclient.
@kenisteward

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions