Skip to content

Not getting headers in response for android clientΒ #4281

@kpradeepkumarreddy

Description

@kpradeepkumarreddy
Description

I have generated code for android client that uses volley library. I want to get headers from response. How can i get the headers from the response ???

Swagger-codegen version

swagger-codegen-cli-2.2.1.jar

Swagger declaration file content or url
 paths:
   /login:
    post:
      summary: send mobileNum and otp to login
      description: send mobileNum and otp to login
      parameters:
       - name: args
         in: query
         description: send mobileNum and otp in args 
         required: true
         type: string
         format: string
     tags:
       - login
     responses:
       '200':
         headers:
           Authorization:  
             description: access token will be set in the authorization header
             type: string
         description: login successful, received accessToken in header and refreshToken in body
         schema:
           $ref: '#/definitions/ResponseTO'
     ```

 ##### Command line used for generation
java -jar swagger-codegen-cli.jar generate -i login1.yml -l android --library=volley -o login-source-code/ -c config.json

=> for adding header to the request, i can use the following code,
     LoginApi loginApi = new LoginApi();
     loginApi.addHeader(String key, String value)

=> How can i get the headers from the response ??????

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions