axios-tauri-api-adapter icon indicating copy to clipboard operation
axios-tauri-api-adapter copied to clipboard

buildTauriRequestData cannot process FormData

Open alexsunday opened this issue 1 year ago • 2 comments

export function buildTauriRequestData(data) {
    if (data === undefined || data === null) {
        return undefined;
    }
    if (typeof data === 'string') {
        return Body.text(data);
    }

// there seems has a bug here, if data is a FormData instance, typeof data === 'object' 
    else if (typeof data === 'object') {
        return Body.json(data);
    }
    else if (data instanceof FormData) {
        // @ts-ignore
        return Body.form(data);
    }
    return Body.bytes(data);
}

alexsunday avatar Oct 04 '23 15:10 alexsunday

Thanks for bringing this up, if you have time to submit a pull request

persiliao avatar Oct 17 '23 23:10 persiliao

The issue is fixed in #19, waiting for approval

Nicoolandgood avatar Jan 30 '24 21:01 Nicoolandgood

The issue is fixed in #19, waiting for approval该问题已修复在 #19 ,等待审批

thanks

persiliao avatar Aug 18 '24 08:08 persiliao