Printer FriendlyEmail Article Link

Avalanche: http / https POST action list examples

Environment/Versions
  • Avalanche
Answer

Example POST syntax:

  • POST with forms database values followed by the next row option:
     
  • 1 POST https://www.somewebsite.com/ username=<filename.$1> password=<filename.$2>

    NEXT ROW <filename>

  • A POST with forms database values from two different files: filename and purchase:

    1 POST https://www.somewebsite.com/cgi-bin/ username=<filename.$1> password=<purchase.$1>

  • A POST with an arbitrary-sized body length:

    1 POST https://www.somewebsite.com<POST_BODY: URLENC KEY=foobar, LENGTH=100>

  • NOTE: The maximum LENGTH you can use with POST_BODY is 20 M.

  • A POST with multiple APPLY statements, and using an arbitrary-sized body length:

ASSIGN VARIABLE <my_host "192.168.1.1">

ASSIGN VARIABLE <my_path2 "dir1/dir2">

ASSIGN VARIABLE <my_file "index.html">

1 POST http://<APPLY my_host>:80/<APPLY my_path2>/<APPLY my_file><POST_BODY: URLENC KEY=foobar, LENGTH=65535>

  • A POST with content from a file to the server:

    1 POST http://192.168.42.11/<POST_FILE="TestFile" CONTENT_TYPE="image/jpg">

  • NOTE: Use the HTTP Content tab on the Client Actions tab to create or import the HTTP body content file that you reference in the action.

    IMPORTANT: The POST command supports uploading a file size up to 20 M to the server.

  • A POST with multiple APPLY statements, and using content from a file to the server:

ASSIGN VARIABLE <my_host "192.168.1.1">

ASSIGN VARIABLE <my_path2 "dir1/dir2">

ASSIGN VARIABLE <my_file "index.html">

1 POST http://<APPLY my_host>:80/<APPLY my_path2>/<APPLY my_file><POST_FILE="content1" CONTENT_TYPE="text">

  • A POST with content from a file to the server, using a multipart Content-Type message:

    1 POST http://192.168.42.11/<POST_FILE="TestFile" CONTENT_TYPE="multipart/mixed;  boundary=gc0p4Jq0M2Yt08jU534c0p">

NOTE: For more information on multipart Content-Type messages, see RFC 1341, section 7.2.

  • POST examples using query key/value lists:
    • 1 POST HTTP://192.168.1.1/login.jsp?location=office

    • 1 POST HTTP://192.168.1.1/login.jsp user=myname password=mypass

    • 1 POST https://www.somewebsite.com/logging.php?action=login&loginsubmit=true username=myname password=mypass

When building the POST request for the example above, the following appears in the request URI:

logging.php?action=login&loginsubmit=true

The following appears in the entity body:

username=myname&password=mypass

NOTES:

  • The POST method supports the following two types of query key/value lists:
    • URI query list - Starts with a question mark (?) and is separated by ampersand (&).
    • Entity body query list - Starts with a space and is separated by spaces.
  • The two types of query lists can be combined in one POST request.
  • Although the entity body query list is separated by spaces in the Actions list, it is separated by ampersand (&) when the request packet is finally built.


Product : Avalanche