forked from usebruno/bruno
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: multipart/form-data body interpolation (usebruno#3142)
* feat: updates * feat: updates * feat: updates * feat: updates
- Loading branch information
Showing
13 changed files
with
165 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions
23
packages/bruno-tests/collection/echo/echo form-url-encoded.bru
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
meta { | ||
name: echo form-url-encoded | ||
type: http | ||
seq: 9 | ||
} | ||
|
||
post { | ||
url: {{echo-host}} | ||
body: formUrlEncoded | ||
auth: none | ||
} | ||
|
||
body:form-urlencoded { | ||
form-data-key: {{form-data-key}} | ||
} | ||
|
||
script:pre-request { | ||
bru.setVar('form-data-key', 'form-data-value'); | ||
} | ||
|
||
assert { | ||
res.body: eq form-data-key=form-data-value | ||
} |
22 changes: 22 additions & 0 deletions
22
packages/bruno-tests/collection/echo/echo multipart scripting.bru
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
meta { | ||
name: echo multipart via scripting | ||
type: http | ||
seq: 10 | ||
} | ||
|
||
post { | ||
url: {{echo-host}} | ||
body: multipartForm | ||
auth: none | ||
} | ||
|
||
assert { | ||
res.body: contains form-data-value | ||
} | ||
|
||
script:pre-request { | ||
const FormData = require("form-data"); | ||
const form = new FormData(); | ||
form.append('form-data-key', 'form-data-value'); | ||
req.setBody(form); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
meta { | ||
name: echo multipart | ||
type: http | ||
seq: 8 | ||
} | ||
|
||
post { | ||
url: {{echo-host}} | ||
body: multipartForm | ||
auth: none | ||
} | ||
|
||
body:multipart-form { | ||
foo: {{form-data-key}} | ||
file: @file(bruno.png) | ||
} | ||
|
||
assert { | ||
res.body: contains form-data-value | ||
} | ||
|
||
script:pre-request { | ||
bru.setVar('form-data-key', 'form-data-value'); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters