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:
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;
}
I'm unable to specify the mime type of the files sent as part of
multipart/form-datarequests 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: