Base Technology
- HTTPie
- https://httpie.org/doc
Parameters
- REST API plugin is subset of HTTPie It is over 90% compatible.
- For all questions about the parameters, you can visit this website for answers.
- https://httpie.org/doc.
Tooltip | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
Right Text Bubble
Left Text Bubble
|
How to UPLOAD files using the REST API plugin
Please see below as a sample parameter settings when you want to upload files to server with the REST API plugin.
Tooltips for
Tooltip | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
Left Text Bubble
Right Text Bubble
|
Tooltips for "Req Item" in the Advance Menu
The tooltip contents is too long to display in the STU screen - for the entire contents please see below.
Req Item
Optional key-value pairs to be included in the request. The separator used
determines the type:
':' HTTP headers:
Referer:http://httpie.org Cookie Cookie:foo=foo User-Agent:bacon/1.0
'==' URL parameters to be appended to the request URI:
search==httpie
'=' Data fields to be serialized into a JSON object (with --json, -j)
or form data (with --form, -f):
name=HTTPie language=Python description='CLI HTTP client'
':=' Non-string JSON data fields (only with --json, -j):
awesome:=true amount:=42 colors:='["red", "green", "blue"]'
'@' Form file fields (only with --form, -f):
cs@~/Documents/CV.pdf
'=@' A data field like '=', but takes a file path and embeds its content:
essay=@Documents/essay.txt
':=@' A raw JSON field like ':=', but takes a file path and embeds its content:
package:=@./package.json
You can use a backslash to escape a colliding
appendIcon | Comment |
---|---|
iconColor | Blue |
width | 720px |
linkText | Text from Image |
Left Text Bubble
- POST method
- Target server URL here
- Use “files” for input_name so it would be files@file_path
- You can upload multiple files
Right Text Bubble
Below are further explanations using a demo upload server.
The code looks like this ---
As you can see,
URL, form, Post, and files are all reflected to the plugin from a source code like this.
FYI, if you are familiar with Python, you can run a quick test with Python’s uploadserver 1.0.0 and build quick target server.
Return Code
Code | Meaning |
---|---|
0 | Execution successful |
1 | Execution failed |