Skip to content
This repository has been archived by the owner on Jul 1, 2021. It is now read-only.

target_http

Marcel Kloubert edited this page Dec 14, 2016 · 26 revisions

Home >> Targets >> http

HTTP

Deploys to a HTTP server/service.

The content of the file will be submitted via the request body.

{
    "deploy": {
        "targets": [
            {
                "type": "http",
                "name": "My HTTP service",
                "description": "A HTTP service on a HTTP server, e.g.",

                "url": "https://host.example.com/webdav/?file=${VSDeploy-File}",
                "method": "PUT",
                "headers": {
                    "X-My-Custom-Header-Date": "Submission date: ${VSDeploy-Date}",
                    "X-My-Custom-Header-File": "The file path is: ${VSDeploy-File}",
                    "X-My-Custom-Header-FileMime": "The mime type of the file: ${VSDeploy-File-Mime}",
                    "X-My-Custom-Header-FileName": "The file name is: ${VSDeploy-File-Name}",
                    "X-My-Custom-Header-FileChanged": "The time the file has been changed: ${VSDeploy-File-Time-Changed}",
                    "X-My-Custom-Header-FileCreated": "The time the file has been created: ${VSDeploy-File-Time-Created}",
                    "X-My-Custom-Header-FileSize": "The file size is: ${VSDeploy-File-Size}"
                },
                "submitContentLength": true,
                "submitFileHeader": true,
                "user": "mkloubert", "password": "P@ssword123!"
            }
        ]
    }
}
Name Description
headers The optional list of additional request headers to send.
method The HTTP method to use. Default PUT
password The optional password for Basic authentication.
submitContentType Submit the Content-type request header or not. Default: (true)
submitContentLength Submit the Content-length request header or not. Default: (true)
submitDate Submit the Date request header or not. Default: (true)
submitFileHeader Submit the X-vsdeploy-file request header that contains the path of the file that is submitted. Default: (false)
transformer The optional path to the script that transforms the data of the file BEFORE it is send. s. [[Transform data
transformerOptions The data for the "data transformation", if needed.
url The request URL.
user The optional username for Basic authentication.

Placeholders

As you can see in the setting example, headers and url can use placeholders:

Name Description Description
VSDeploy-Date The submission (not the file) date in RFC 2822 format. Sun, 23 sep 1979 05:09:00 GMT
VSDeploy-File The path of the file that is submitted. /the/path/of/the/file.txt
VSDeploy-File-Mime The mime/content type of the file that is submitted. text/plain
VSDeploy-File-Name The name of the file that is submitted. file.txt
VSDeploy-File-Size The size of the file that is submitted. 5979
VSDeploy-File-Time-Changed The time the file that is submitted has been changed. Fri, 23 sep 2016 05:09:00 GMT
VSDeploy-File-Time-Created The time the file that is submitted has been created. Mon, 05 sep 2016 23:09:00 GMT

All placeholders are case insensitive.

Clone this wiki locally