Open Accumulative opened 2 years ago
I'm unable to specify the mime type of the files sent as part of multipart/form-data requests using the python requests module.
multipart/form-data
I believe the relevant code is here: https://github.com/Kong/httpsnippet/blob/master/src/targets/python/requests/client.ts#L82
I was thinking we could support it by making a change like so:
if (p.fileName) { if (p.mimeType) { files[p.name] = `('${p.fileName}', open('${p.fileName}', 'rb'), '${p.mimeType}')`; } else { // current behaviour files[p.name] = `open('${p.fileName}', 'rb')`; } hasFiles = true; } else { payload[p.name] = p.value; hasPayload = true; }
bump
I'm unable to specify the mime type of the files sent as part of
multipart/form-data
requests using the python requests module.I believe the relevant code is here: https://github.com/Kong/httpsnippet/blob/master/src/targets/python/requests/client.ts#L82
I was thinking we could support it by making a change like so: