From 255b86e29e8201daf25c90a264c84b5611f27a22 Mon Sep 17 00:00:00 2001 From: Tim Bond Date: Mon, 7 Feb 2022 00:58:32 -0800 Subject: [PATCH] Always set method to POST when data-raw flag is present Per the cURL manual[1] the `--data-raw` flag POSTs data 1: https://curl.se/docs/manpage.html#--data-raw --- resources/js/curl-to-php.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/resources/js/curl-to-php.js b/resources/js/curl-to-php.js index 5c87c7f..107e82b 100644 --- a/resources/js/curl-to-php.js +++ b/resources/js/curl-to-php.js @@ -261,8 +261,10 @@ function curlToPHP(curl) { loadData(cmd.d); if (cmd.data) loadData(cmd.data); - if (cmd['data-raw']) + if (cmd['data-raw']) { loadData(cmd['data-raw']); + relevant.method = 'POST'; + } if (cmd['data-binary']) loadData(cmd['data-binary']); if (cmd.F)