Skip to content

Allow responseType config on axios requets. This is required in some …#2590

Open
suryakand wants to merge 1 commit intoferdikoomen:mainfrom
suryakand:feature/axios-responseType-config
Open

Allow responseType config on axios requets. This is required in some …#2590
suryakand wants to merge 1 commit intoferdikoomen:mainfrom
suryakand:feature/axios-responseType-config

Conversation

@suryakand
Copy link
Copy Markdown

Hi @ferdikoomen,

Allow 'responseType' config on axios requets. This is required in some cases (like file download). Here is example:

    const client = new GeneratedClient();
    client.request.config.responseType = 'arraybuffer';
    const res: any = await client.documents.documentsDownloadRetrieve(docId, original);  
    return res;

@ferdikoomen - Please review and merge. Let me know if I can provide more details or if there is alternate way to provide responseType on axios requests.

Looks like a similar PR is there. #986

Allowing responseType configuration via config object will allow user to override/configure it as needed for each request individually.

export type ResponseType =
    | 'arraybuffer'
    | 'blob'
    | 'document'
    | 'json'
    | 'text'
    | 'stream'
    | 'formdata';

Thanks!
Surya

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant