Postman text body import

This commit is contained in:
Gregory Schier
2024-04-02 10:10:16 +02:00
parent 5608db1334
commit 7d3f0ad549
2 changed files with 15 additions and 1 deletions

View File

@@ -191,6 +191,20 @@ function importBody(rawBody: any): Pick<HttpRequest, 'body' | 'bodyType' | 'head
), ),
}, },
}; };
} else if ('raw' in body) {
return {
headers: [
{
name: 'Content-Type',
value: body.options?.raw?.language === 'json' ? 'application/json' : '',
enabled: true,
},
],
bodyType: body.options?.raw?.language === 'json' ? 'application/json' : 'other',
body: {
text: body.raw ?? '',
},
};
} else { } else {
// TODO: support other body types // TODO: support other body types
return { headers: [], bodyType: null, body: {} }; return { headers: [], bodyType: null, body: {} };

View File

@@ -8,7 +8,7 @@
}, },
"package": { "package": {
"productName": "Yaak", "productName": "Yaak",
"version": "2024.3.9" "version": "2024.3.10"
}, },
"tauri": { "tauri": {
"windows": [], "windows": [],