diff --git a/packages/bruno-app/src/utils/curl/curl-to-json.js b/packages/bruno-app/src/utils/curl/curl-to-json.js index 44d9c4b2bc..48c33bb0ae 100644 --- a/packages/bruno-app/src/utils/curl/curl-to-json.js +++ b/packages/bruno-app/src/utils/curl/curl-to-json.js @@ -57,6 +57,8 @@ function getDataString(request) { console.error('Failed to parse JSON data:', error); return { data: request.data.toString() }; } + } else if (contentType && contentType.includes('application/xml')) { + return { data: request.data }; } const parsedQueryString = querystring.parse(request.data, { sort: false }); diff --git a/packages/bruno-app/src/utils/curl/index.js b/packages/bruno-app/src/utils/curl/index.js index e478a8e7e4..f486df56bc 100644 --- a/packages/bruno-app/src/utils/curl/index.js +++ b/packages/bruno-app/src/utils/curl/index.js @@ -60,7 +60,7 @@ export const getRequestFromCurlCommand = (curlCommand, requestType = 'http-reque } else if (contentType.includes('application/json')) { body.mode = 'json'; body.json = convertToCodeMirrorJson(parsedBody); - } else if (contentType.includes('text/xml')) { + } else if (contentType.includes('xml')) { body.mode = 'xml'; body.xml = parsedBody; } else if (contentType.includes('application/x-www-form-urlencoded')) {