mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-06 15:58:39 +09:00
DevTools - network - Copy as cURL (POST)
https://github.com/MoonchildProductions/moebius/pull/167
This commit is contained in:
parent
1a8810305a
commit
59559355e6
2 changed files with 20 additions and 2 deletions
|
|
@ -76,7 +76,8 @@ const Curl = {
|
|||
|
||||
// Create post data.
|
||||
let postData = [];
|
||||
if (utils.isUrlEncodedRequest(data) || data.method == "PUT") {
|
||||
if (utils.isUrlEncodedRequest(data) ||
|
||||
["PUT", "POST"].includes(data.method)) {
|
||||
postDataText = data.postDataText;
|
||||
postData.push("--data");
|
||||
postData.push(escapeString(utils.writePostDataTextParams(postDataText)));
|
||||
|
|
@ -207,6 +208,9 @@ const CurlUtils = {
|
|||
* Post data parameters.
|
||||
*/
|
||||
writePostDataTextParams: function (postDataText) {
|
||||
if (!postDataText) {
|
||||
return "";
|
||||
}
|
||||
let lines = postDataText.split("\r\n");
|
||||
return lines[lines.length - 1];
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue