Send a put request to an HTTP or HTTPS server

WTSupported in traditional Synergy on Windows
WNSupported in Synergy .NET on Windows
USupported on UNIX
VSupported on OpenVMS
status = %HTTP_PUT(uri, [timeout], send_document, receive_document, error, in_headers,
&        [log_file], [protocols], [ciphers], [cert_file], [CA_file], [HTTP_RELURI][, version])


status = %HTTP_PUT(uri, [timeout], send_document, receive_document, error, in_headers,
&        [log_file], [protocols], [ciphers], [cert_file], [CA_file], [HTTP_RELURI], [version], 
&        out_headers)

Return value


Returns 0 if successful or an error number if unsuccessful.



The absolute URI (Uniform Resource Indicator) of the document to put to the HTTP server. (a)


(optional) The number of seconds to wait from the time a request is sent (after the connection to the server) until a response is received from the server. The default is 0, which specifies wait forever. (n)


The document to put to the HTTP server. (System.String)


The document received in response to the put request. If there is no receive document, this is ^NULL. (System.String)


Returned with an error message if status is nonzero. Otherwise, it is ^NULL. (System.String)


A dynamic array of one or more HTTP header strings. Each string has the form header_name[:value]. If not needed, pass ^NULL. ([*]System.String)


(optional) The name and location of a log file to log HTTP packet contents. (a)


(optional) One or more SSL protocol versions in effect, separated by a plus sign (for example, SSLVER_TLS1_1+SSLVER_TLS1_2): (n)

SSLVER_SSL2 = SSL version 2 (deprecated)

SSLVER_SSL3 = SSL version 3 (deprecated)

SSLVER_TLS1 = TLS version 1.0 (deprecated)

SSLVER_TLS1_1 = TLS version 1.1

SSLVER_TLS1_2 = TLS version 1.2

SSLVER_ALL = All protocols are available.

The default protocol is SSLVER_TLS1+SSLVER_TLS1_1+SSLVER_TLS1_2 for OpenSSL 1.0.1 and above and SSLVER_TLS1 for OpenSSL versions below 1.0.1.


Since SSL 2, SSL 3, and TLS 1 have been deprecated, we recommend using TLS 1.1 or TLS 1.2 for secure sites.


(optional) A cipher list that specifies the encryption methods in effect. (a)


(optional) The name of the client certificate file. (a)


(optional) The name of a file containing certificate authorities that the client trusts. (a)


(optional) If passed, the absolute URI is translated and sent as a relative path in the HTTP request. If not passed, the absolute URI is sent with the path exactly as specified. (n)


(optional) A string that contains the HTTP version number to be placed in the document header. The default version number is 1.0. (a)


A dynamic array System.String to receive one or more returned HTTP header strings. If no headers are returned, this is ^NULL. ([*]System.String)


%HTTP_PUT sends a “put” request to an HTTP or HTTPS server, which enables the client to send the specified document to the server. The response from the server is returned in the form of a memory handle.

A “put” request is different from a “post” request in that a “put” is repeatable, having the same results each time it is performed. A “put” request will create or update the full contents of the specified resource, while a “post” request will create or update a subordinate of the specified resource.

The value of uri determines what type of connection will be made to the server. If you pass an HTTP URI, the client establishes an HTTP connection. If you pass an HTTPS URI, the client establishes an SSL connection.

If the returned document is not needed, specify receive_document as ^NULL. If receive_document is specified, a System.String object is created containing the returned document.

For most applications, the standard default HTTP headers will work as provided. However, some HTTP servers require extra header values to process the HTTP message properly. The in_headers argument therefore enables you to add or modify headers for client PUT requests. If you pass in a header name that was previously set, the last header value passed for that name will be the one sent in the HTTP message.

Passing a log_file causes both the HTTP request packet and the HTTP response packet to be logged to the specified file. This logging feature is available primarily for debugging purposes and should not normally be turned on in a secure production environment. Logs of a request packet include the HTTP method (in this case, PUT), the URI, the HTTP version, all HTTP headers, and the body of the HTTP packet. Logs of a response packet include the HTTP version, status, reason, all HTTP headers, and the body of the HTTP packet. Log entries are always appended to an existing log file. If the log file does not exist, it is created. A log file can only be created on a local drive; remote drives are not supported.

If ciphers is not specified, the ciphers designated by the cipher list format value DEFAULT are in effect. See Ciphers for more information and a list of supported ciphers.

If specified, cert_file and CA_file must be the names of existing files in PEM or DER format. A PEM certificate file may contain both the certificate and private key. If it doesn’t contain the private key, the Synergy HTTP document transport API will load a PEM-based key file whose name is derived by appending “key.pem” to the end of the certificate filename. For example, if a certificate file is named test.der or test.pem, the API will load a key file named testkey.pem. If an authentication error occurs, the error is returned and the connection is terminated.