-
-
Notifications
You must be signed in to change notification settings - Fork 49
Description
Currently there is no way to do this. There are two tasks for this are closely related, so they both should be added.
Loading a raw body from a file
A new body type is added to the dropdown:

When this option is picked, the pane details expand to a file picker and a text input to set the content-type (application/octet-stream by default; but you can change it if you want.)
At the data model, this is another body type. This is not the same as a raw request.
When the request is submitted, the contents of the file are read, and these are attached just like they would be sent in a request with raw body.
When the request is saved, the type is set to "file" and the path to the actual file is included in the .cartero file:
[body]
type = "file"
file = "assets/banner.jpg"
type = "image/jpeg"
Attaching files to multipart requests
Multipart requests allow mixing inline text parts with file parts. A "Add field" button should be added below the table, that allows to attach extra files to the multipart body.
The file is rendered in the table, so that you can see the file name, and disable it if you want. But the field is not editable. The ··· button might present a way to "open" the file, as in "open this image or file with the default application in your computer to open these files".

(This is just a mock, don't consider this final.)
When the request is sent, the contents of the file are added to the request. The content-type, if available, is passed through.
When serialized to a file, a new sub-table for the files attached to a multipart request is added with the path to each file.
[body]
type = "multipart"
[body.variables]
user = "admin@example.com"
password = "1234"
[body.files]
avatar = "file.jpg"
id_card = { value = "fixtures/id_card.png", active = false }
Metadata
Metadata
Assignees
Labels
Projects
Status