mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-25 04:34:06 -08:00
🐛 Fix bug with responseFormat "file" for POST-Requests
This commit is contained in:
parent
e272c69f07
commit
4165fad307
|
@ -772,6 +772,19 @@ export class HttpRequest implements INodeType {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (responseFormat === 'file') {
|
||||||
|
requestOptions.encoding = null;
|
||||||
|
requestOptions.body = JSON.stringify(requestOptions.body);
|
||||||
|
if (requestOptions.headers === undefined) {
|
||||||
|
requestOptions.headers = {};
|
||||||
|
}
|
||||||
|
requestOptions.headers['Content-Type'] = 'application/json';
|
||||||
|
} else if (options.bodyContentType === 'raw') {
|
||||||
|
requestOptions.json = false;
|
||||||
|
} else {
|
||||||
|
requestOptions.json = true;
|
||||||
|
}
|
||||||
|
|
||||||
// Add Content Type if any are set
|
// Add Content Type if any are set
|
||||||
if (options.bodyContentCustomMimeType) {
|
if (options.bodyContentCustomMimeType) {
|
||||||
if(requestOptions.headers === undefined) {
|
if(requestOptions.headers === undefined) {
|
||||||
|
@ -808,14 +821,6 @@ export class HttpRequest implements INodeType {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (responseFormat === 'file') {
|
|
||||||
requestOptions.encoding = null;
|
|
||||||
} else if(options.bodyContentType === 'raw') {
|
|
||||||
requestOptions.json = false;
|
|
||||||
} else {
|
|
||||||
requestOptions.json = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Now that the options are all set make the actual http request
|
// Now that the options are all set make the actual http request
|
||||||
if (oAuth1Api !== undefined) {
|
if (oAuth1Api !== undefined) {
|
||||||
requestPromises.push(this.helpers.requestOAuth1.call(this, 'oAuth1Api', requestOptions));
|
requestPromises.push(this.helpers.requestOAuth1.call(this, 'oAuth1Api', requestOptions));
|
||||||
|
|
Loading…
Reference in a new issue