Tests curl command generation
cURL Windows:
curl "http://example.org/path"
cURL Unix:
curl 'http://example.org/path'
Powershell:
Invoke-WebRequest -UseBasicParsing -Uri "http://example.org/path"
fetch (for browser):
fetch("http://example.org/path", {
"method": "GET",
"mode": "cors",
"credentials": "omit"
});
fetch (for nodejs):
fetch("http://example.org/path", {
"method": "GET"
});
cURL Windows:
curl "http://example.org/path" --data-raw "123"
cURL Unix:
curl 'http://example.org/path' --data-raw '123'
Powershell:
Invoke-WebRequest -UseBasicParsing -Uri "http://example.org/path" `
-Method "POST" `
-Body "123"
fetch (for browser):
fetch("http://example.org/path", {
"body": "123",
"method": "POST",
"mode": "cors",
"credentials": "omit"
});
fetch (for nodejs):
fetch("http://example.org/path", {
"body": "123",
"method": "POST"
});
cURL Windows:
curl "http://example.org/path" ^
-H "Content-Type: application/x-www-form-urlencoded" ^
--data-raw "1&b"
cURL Unix:
curl 'http://example.org/path' \
-H 'Content-Type: application/x-www-form-urlencoded' \
--data-raw '1&b'
Powershell:
Invoke-WebRequest -UseBasicParsing -Uri "http://example.org/path" `
-Method "POST" `
-ContentType "application/x-www-form-urlencoded" `
-Body "1&b"
fetch (for browser):
fetch("http://example.org/path", {
"headers": {
"content-type": "application/x-www-form-urlencoded"
},
"body": "1&b",
"method": "POST",
"mode": "cors",
"credentials": "omit"
});
fetch (for nodejs):
fetch("http://example.org/path", {
"headers": {
"content-type": "application/x-www-form-urlencoded"
},
"body": "1&b",
"method": "POST"
});
cURL Windows:
curl "http://example.org/path" ^
-H "Content-Type: application/json" ^
--data-raw ^"^{^\^"a^\^":1^}^"
cURL Unix:
curl 'http://example.org/path' \
-H 'Content-Type: application/json' \
--data-raw '{"a":1}'
Powershell:
Invoke-WebRequest -UseBasicParsing -Uri "http://example.org/path" `
-Method "POST" `
-ContentType "application/json" `
-Body "{`"a`":1}"
fetch (for browser):
fetch("http://example.org/path", {
"headers": {
"content-type": "application/json"
},
"body": "{\"a\":1}",
"method": "POST",
"mode": "cors",
"credentials": "omit"
});
fetch (for nodejs):
fetch("http://example.org/path", {
"headers": {
"content-type": "application/json"
},
"body": "{\"a\":1}",
"method": "POST"
});
cURL Windows:
curl "http://example.org/path" ^
-H "Content-Type: application/binary" ^
--data-raw ^"1234^
00^^^^'^\^"^!^"
cURL Unix:
curl 'http://example.org/path' \
-H 'Content-Type: application/binary' \
--data-raw $'1234\r\n00\u0002\u0003\u0004\u0005\'"\u0021'
Powershell:
Invoke-WebRequest -UseBasicParsing -Uri "http://example.org/path" `
-Method "POST" `
-ContentType "application/binary" `
-Body ([System.Text.Encoding]::UTF8.GetBytes("1234$([char]13)$([char]10)00$([char]2)$([char]3)$([char]4)$([char]5)'`"!"))
fetch (for browser):
fetch("http://example.org/path", {
"headers": {
"content-type": "application/binary"
},
"body": "1234\r\n00\u0002\u0003\u0004\u0005'\"!",
"method": "POST",
"mode": "cors",
"credentials": "omit"
});
fetch (for nodejs):
fetch("http://example.org/path", {
"headers": {
"content-type": "application/binary"
},
"body": "1234\r\n00\u0002\u0003\u0004\u0005'\"!",
"method": "POST"
});
cURL Windows:
curl "http://example.org/path" ^
-H "Content-Type: application/binary" ^
--data-raw ^"1234^
^00^^^^'^\^"^!^"
cURL Unix:
curl 'http://example.org/path' \
-H 'Content-Type: application/binary' \
--data-raw $'1234\r\n\u000100\u0002\u0003\u0004\u0005\'"\u0021'
Powershell:
Invoke-WebRequest -UseBasicParsing -Uri "http://example.org/path" `
-Method "POST" `
-ContentType "application/binary" `
-Body ([System.Text.Encoding]::UTF8.GetBytes("1234$([char]13)$([char]10)$([char]1)00$([char]2)$([char]3)$([char]4)$([char]5)'`"!"))
fetch (for browser):
fetch("http://example.org/path", {
"headers": {
"content-type": "application/binary"
},
"body": "1234\r\n\u000100\u0002\u0003\u0004\u0005'\"!",
"method": "POST",
"mode": "cors",
"credentials": "omit"
});
fetch (for nodejs):
fetch("http://example.org/path", {
"headers": {
"content-type": "application/binary"
},
"body": "1234\r\n\u000100\u0002\u0003\u0004\u0005'\"!",
"method": "POST"
});
cURL Windows:
curl "http://example.org/path" ^
-H "Content-Type: application/binary" ^
--data-raw ^"^%^OS^%^
^%^%^OS^%^%^
^\^"^\^\^\^"'^$&^!^"
cURL Unix:
curl 'http://example.org/path' \
-H 'Content-Type: application/binary' \
--data-raw $'%OS%\r\n%%OS%%\r\n"\\"\'$&\u0021'
Powershell:
Invoke-WebRequest -UseBasicParsing -Uri "http://example.org/path" `
-Method "POST" `
-ContentType "application/binary" `
-Body ([System.Text.Encoding]::UTF8.GetBytes("%OS%$([char]13)$([char]10)%%OS%%$([char]13)$([char]10)`"\`"'`$&!"))
fetch (for browser):
fetch("http://example.org/path", {
"headers": {
"content-type": "application/binary"
},
"body": "%OS%\r\n%%OS%%\r\n\"\\\"'$&!",
"method": "POST",
"mode": "cors",
"credentials": "omit"
});
fetch (for nodejs):
fetch("http://example.org/path", {
"headers": {
"content-type": "application/binary"
},
"body": "%OS%\r\n%%OS%%\r\n\"\\\"'$&!",
"method": "POST"
});
cURL Windows:
curl "http://example.org/path" ^
-H "Content-Type: application/binary" ^
--data-raw ^"^!^@^#^$^%^^&*()_+~`1234567890-=^[^]^{^};':^\^",./
^<^>?^
qwer^
t^
^
yuiopasdfghjklmnbvcxzQWERTYUIOPLKJHGFDSAZXCVBNM^"
cURL Unix:
curl 'http://example.org/path' \
-H 'Content-Type: application/binary' \
--data-raw $'\u0021@#$%^&*()_+~`1234567890-=[]{};\':",./\r<>?\r\nqwer\nt\n\nyuiopasdfghjklmnbvcxzQWERTYUIOPLKJHGFDSAZXCVBNM'
Powershell:
Invoke-WebRequest -UseBasicParsing -Uri "http://example.org/path" `
-Method "POST" `
-ContentType "application/binary" `
-Body ([System.Text.Encoding]::UTF8.GetBytes("!@#`$%^&*()_+~``1234567890-=[]{};':`",./$([char]13)<>?$([char]13)$([char]10)qwer$([char]10)t$([char]10)$([char]10)yuiopasdfghjklmnbvcxzQWERTYUIOPLKJHGFDSAZXCVBNM"))
fetch (for browser):
fetch("http://example.org/path", {
"headers": {
"content-type": "application/binary"
},
"body": "!@#$%^&*()_+~`1234567890-=[]{};':\",./\r<>?\r\nqwer\nt\n\nyuiopasdfghjklmnbvcxzQWERTYUIOPLKJHGFDSAZXCVBNM",
"method": "POST",
"mode": "cors",
"credentials": "omit"
});
fetch (for nodejs):
fetch("http://example.org/path", {
"headers": {
"content-type": "application/binary"
},
"body": "!@#$%^&*()_+~`1234567890-=[]{};':\",./\r<>?\r\nqwer\nt\n\nyuiopasdfghjklmnbvcxzQWERTYUIOPLKJHGFDSAZXCVBNM",
"method": "POST"
});
cURL Windows:
curl "http://example.org/path" ^
-H "Content-Type: application/binary" ^
--data-raw ^"^^^^ÿ ^܀^"
cURL Unix:
curl 'http://example.org/path' \
-H 'Content-Type: application/binary' \
--data-raw $'\u007f\u0080\u0090ÿ\u0009܀'
Powershell:
Invoke-WebRequest -UseBasicParsing -Uri "http://example.org/path" `
-Method "POST" `
-ContentType "application/binary" `
-Body ([System.Text.Encoding]::UTF8.GetBytes("$([char]127)$([char]128)$([char]144)$([char]255)$([char]9)$([char]1792)"))
fetch (for browser):
fetch("http://example.org/path", {
"headers": {
"content-type": "application/binary"
},
"body": "ÿ\t܀",
"method": "POST",
"mode": "cors",
"credentials": "omit"
});
fetch (for nodejs):
fetch("http://example.org/path", {
"headers": {
"content-type": "application/binary"
},
"body": "ÿ\t܀",
"method": "POST"
});
cURL Windows:
curl ^"http://labs.ft.com/?querystring=^\[^\]^\{^\}^"
cURL Unix:
curl 'http://labs.ft.com/?querystring=\[\]\{\}'
Powershell:
Invoke-WebRequest -UseBasicParsing -Uri "http://labs.ft.com/?querystring=[]{}"
fetch (for browser):
fetch("http://labs.ft.com/?querystring=[]{}", {
"body": null,
"method": "GET",
"mode": "cors",
"credentials": "omit"
});
fetch (for nodejs):
fetch("http://labs.ft.com/?querystring=[]{}", {
"body": null,
"method": "GET"
});
cURL Windows:
curl "http://example.org/path" ^
-H "Content-Type: application/binary" ^
--data-raw ^"^%^PATH^%^$PATH^"
cURL Unix:
curl 'http://example.org/path' \
-H 'Content-Type: application/binary' \
--data-raw '%PATH%$PATH'
Powershell:
Invoke-WebRequest -UseBasicParsing -Uri "http://example.org/path" `
-Method "POST" `
-ContentType "application/binary" `
-Body "%PATH%`$PATH"
fetch (for browser):
fetch("http://example.org/path", {
"headers": {
"content-type": "application/binary"
},
"body": "%PATH%$PATH",
"method": "POST",
"mode": "cors",
"credentials": "omit"
});
fetch (for nodejs):
fetch("http://example.org/path", {
"headers": {
"content-type": "application/binary"
},
"body": "%PATH%$PATH",
"method": "POST"
});
cURL Windows:
curl "http://example.org/path"
cURL Unix:
curl 'http://example.org/path'
Powershell:
Invoke-WebRequest -UseBasicParsing -Uri "http://example.org/path" -Headers @{
"version"="v"
}
fetch (for browser):
fetch("http://example.org/path", {
"method": "GET",
"mode": "cors",
"credentials": "omit"
});
fetch (for nodejs):
fetch("http://example.org/path", {
"method": "GET"
});
cURL Windows:
curl "http://example.org/path" -H "Cookie: _x=fdsfs; aA=fdsfdsf; FOO=ID=BAR:BAZ=FOO:F=d:AO=21.212.2.212-:A=dsadas8d9as8d9a8sd9sa8d9a; AAA=117"
cURL Unix:
curl 'http://example.org/path' -H 'Cookie: _x=fdsfs; aA=fdsfdsf; FOO=ID=BAR:BAZ=FOO:F=d:AO=21.212.2.212-:A=dsadas8d9as8d9a8sd9sa8d9a; AAA=117'
Powershell:
Invoke-WebRequest -UseBasicParsing -Uri "http://example.org/path"
fetch (for browser):
fetch("http://example.org/path", {
"method": "GET",
"mode": "cors",
"credentials": "include"
});
fetch (for nodejs):
fetch("http://example.org/path", {
"headers": {
"cookie": "_x=fdsfs; aA=fdsfdsf; FOO=ID=BAR:BAZ=FOO:F=d:AO=21.212.2.212-:A=dsadas8d9as8d9a8sd9sa8d9a; AAA=117"
},
"method": "GET"
});
cURL Windows:
curl "http://example.org/path" -X ^"^|evilcommand^|^"
cURL Unix:
curl 'http://example.org/path' -X '|evilcommand|'
Powershell:
Invoke-WebRequest -UseBasicParsing -Uri "http://example.org/path" -Method "|evilcommand|"
fetch (for browser):
fetch("http://example.org/path", {
"body": null,
"method": "|evilcommand|",
"mode": "cors",
"credentials": "omit"
});
fetch (for nodejs):
fetch("http://example.org/path", {
"body": null,
"method": "|evilcommand|"
});
cURL Windows:
curl "http://example.org/path" ^
-H "Content-Type: application/x-www-form-urlencoded" ^
--data-raw ^"^@/etc/passwd^"
cURL Unix:
curl 'http://example.org/path' \
-H 'Content-Type: application/x-www-form-urlencoded' \
--data-raw '@/etc/passwd'
Powershell:
Invoke-WebRequest -UseBasicParsing -Uri "http://example.org/path" `
-Method "POST" `
-ContentType "application/x-www-form-urlencoded" `
-Body "@/etc/passwd"
fetch (for browser):
fetch("http://example.org/path", {
"headers": {
"content-type": "application/x-www-form-urlencoded"
},
"body": "@/etc/passwd",
"method": "POST",
"mode": "cors",
"credentials": "omit"
});
fetch (for nodejs):
fetch("http://example.org/path", {
"headers": {
"content-type": "application/x-www-form-urlencoded"
},
"body": "@/etc/passwd",
"method": "POST"
});
cURL Windows:
curl "http://example.org/path" -H "Referer: https://example.com"
cURL Unix:
curl 'http://example.org/path' -H 'Referer: https://example.com'
Powershell:
Invoke-WebRequest -UseBasicParsing -Uri "http://example.org/path" -Headers @{
"Referer"="https://example.com"
}
fetch (for browser):
fetch("http://example.org/path", {
"referrer": "https://example.com",
"method": "GET",
"mode": "cors",
"credentials": "omit"
});
fetch (for nodejs):
fetch("http://example.org/path", {
"headers": {
"Referer": "https://example.com"
},
"method": "GET"
});
cURL Windows:
curl "http://example.org/path" -H "No-Value-Header;"
cURL Unix:
curl 'http://example.org/path' -H 'No-Value-Header;'
Powershell:
Invoke-WebRequest -UseBasicParsing -Uri "http://example.org/path" -Headers @{
"No-Value-Header"=""
}
fetch (for browser):
fetch("http://example.org/path", {
"headers": {
"no-value-header": ""
},
"method": "GET",
"mode": "cors",
"credentials": "omit"
});
fetch (for nodejs):
fetch("http://example.org/path", {
"headers": {
"no-value-header": ""
},
"method": "GET"
});
cURL Windows:
cURL Unix:
Powershell:
fetch (for browser):
fetch (for nodejs):
cURL Windows:
cURL Unix:
Powershell:
fetch (for browser):
fetch (for nodejs):
cURL Windows:
cURL Unix:
Powershell:
fetch (for browser):
fetch (for nodejs):
cURL Windows:
curl "http://example.org/path" ^
-H "Content-Type: foo/bar" ^
--data-raw "baz"
cURL Unix:
curl 'http://example.org/path' \
-H 'Content-Type: foo/bar' \
--data-raw 'baz'
Powershell:
Invoke-WebRequest -UseBasicParsing -Uri "http://example.org/path" `
-Method "POST" `
-ContentType "foo/bar" `
-Body "baz"
fetch (for browser):
fetch("http://example.org/path", {
"headers": {
"content-type": "foo/bar"
},
"body": "baz",
"method": "POST",
"mode": "cors",
"credentials": "omit"
});
fetch (for nodejs):
fetch("http://example.org/path", {
"headers": {
"content-type": "foo/bar"
},
"body": "baz",
"method": "POST"
});
cURL Windows:
curl "http://example.org/path" ^
-H "Content-Type: foo/bar" ^
--data-raw "baz"
cURL Unix:
curl 'http://example.org/path' \
-H 'Content-Type: foo/bar' \
--data-raw 'baz'
Powershell:
Invoke-WebRequest -UseBasicParsing -Uri "http://example.org/path" `
-Method "POST" `
-ContentType "foo/bar" `
-Body "baz"
fetch (for browser):
fetch("http://example.org/path", {
"headers": {
"content-type": "foo/bar"
},
"body": "baz",
"method": "POST",
"mode": "cors",
"credentials": "omit"
});
fetch (for nodejs):
fetch("http://example.org/path", {
"headers": {
"content-type": "foo/bar"
},
"body": "baz",
"method": "POST"
});