Postman text body import

This commit is contained in:
Gregory Schier
2024-04-02 10:10:16 +02:00
parent fd2132994b
commit ba5bfd07f7
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 {
// TODO: support other body types
return { headers: [], bodyType: null, body: {} };

View File

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