Merge branch 'master' into bug/3447-write-only
This commit is contained in:
@@ -20,7 +20,7 @@ export default function curl( request ){
|
||||
if ( request.get("body") ){
|
||||
|
||||
if(type === "multipart/form-data" && request.get("method") === "POST") {
|
||||
for( let [ k,v ] of request.get("body").values()) {
|
||||
for( let [ k,v ] of request.get("body").entrySeq()) {
|
||||
curlified.push( "-F" )
|
||||
if (v instanceof win.File) {
|
||||
curlified.push( `"${k}=@${v.name};type=${v.type}"` )
|
||||
|
||||
@@ -132,10 +132,10 @@ describe("curlify", function() {
|
||||
url: "http://example.com",
|
||||
method: "POST",
|
||||
headers: { "content-type": "multipart/form-data" },
|
||||
body: [
|
||||
["id", "123"],
|
||||
["name", "Sahar"]
|
||||
]
|
||||
body: {
|
||||
id: "123",
|
||||
name: "Sahar"
|
||||
}
|
||||
}
|
||||
|
||||
let curlified = curl(Im.fromJS(req))
|
||||
@@ -152,10 +152,10 @@ describe("curlify", function() {
|
||||
url: "http://example.com",
|
||||
method: "POST",
|
||||
headers: { "content-type": "multipart/form-data" },
|
||||
body: [
|
||||
["id", "123"],
|
||||
["file", file]
|
||||
]
|
||||
body: {
|
||||
id: "123",
|
||||
file
|
||||
}
|
||||
}
|
||||
|
||||
let curlified = curl(Im.fromJS(req))
|
||||
|
||||
Reference in New Issue
Block a user