Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.





REST API 

To provide a command-line-interface like HTTP capabilities to bots.



Need help?

Technical contact to tech@argos-labs.com


May you search all operations,



Base Technology


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
appendIconComment
iconColorBlue
width720px
linkTextText from Image

Right Text Bubble

Left Text Bubble

  • REST API plugin is over 90% compatible to HTTPie technology. Please visit https://httpie.org/doc for detailed explanation





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
appendIconComment
iconColorBlue
width720px
linkTextText 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

  • Make sure to check req_item
  • Make sure to check form

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

Tooltip
appendIconComment
iconColorBlue
width720px
linkTextText 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

  • Make sure to check req_item
  • Make sure to check form



    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
    0Execution successful
    1Execution failed