ODBC Driver for REST

Build 26.0.9770

httpopsUpload

The httpopsUpload operation is an APIScript operation that is used to make HTTP requests with multipart form data to upload files to Web servers compliant with RFC1867 (INPUT TYPE=FILE).

Input Parameters

You can use api:set to specify the operation's input parameters, as shown below.

    <api:set  attr="url"                      value="http://www.example.com/target" />
  

Required Parameters

  • URL: The destination URL for the post.

HTTP

  • Method: The HTTP Method. Default is POST.
  • Data: Form input variable data to include in the post, specified in the form name=value.
  • File:*: Path to a file to be uploaded.
  • Form:*: Form input variable data to include in the post.
  • ContentType:*: If set, the post will specify this content type for the form field.
  • Name:*: If set, the post will use this as the name of the form or file field.
  • FileData:*: File data to be uploaded, specified as a base64 string. Requires the filename field to be specified.
  • FileName:*: Filename to include with filedata content. Required when using the filedata field.
  • Header:Name#: The name for each custom header to pass with the request.
  • Header:Value#: The value for each custom header to pass with the request.
  • Cookie:*: Any cookies that should be added to the request.
  • Timeout: The timeout, in seconds, for the operation to complete. Zero (0) means no timeout. The default value is 60.
  • Logfile: The file where exchanged/transferred data is logged.
  • Verbosity: The detail level to use when logging the exchanged/transferred data to the file specified by the logfile input.

Authentication

  • User: The username to authenticate with if the authscheme parameter is set to something other than None.
  • Password: The password to authenticate with if the authscheme parameter is set to something other than None.
  • AuthScheme: The authorization mechanism to use. Only relevant if user and password are provided. Valid values are BASIC, DIGEST, and NTLM. Default is BASIC.
  • KerberosKDC: The KDC setting of Kerberos, available when AuthScheme is NEGOTIATE.
  • KerberosRealm: The Realm setting of Kerberos, available when AuthScheme is NEGOTIATE.

OAuth

  • Version: The OAuth version. Use OAuth to authorize the request. The allowed values are DISABLED, 1.0, 2.0. The default value is DISABLED.
  • Token: The access token for OAuth.
  • Token_Secret: The access token secret. OAuth 1.0 only.
  • Client_Id: The OAuth client Id. OAuth 1.0 only.
  • Client_Secret: The OAuth client secret. OAuth 1.0 only.
  • Sign_Method: The signature method used to calculate the signature for OAuth 1.0. The allowed values are HMAC-SHA1, PLAINTEXT. The default value is HMAC-SHA1.

Proxy

  • Proxy_Auto: Whether or not the proxy should be detected from Windows system settings. This takes precedence over other proxy settings and is not available in Java. Source is proxy_auto. The allowed values are TRUE, FALSE. The default value is FALSE.
  • Proxy_Server: IP address or host name of the proxy server used for the request. Source is proxy_server.
  • Proxy_Port: The port number of the proxy server. Source is proxy_port.
  • Proxy_User: The user Id used to authenticate with the proxy server. Source is proxy_user.
  • Proxy_Password: The password used to authenticate with the proxy server. Source is proxy_password.
  • Proxy_AuthScheme: The authentication scheme of the proxy server. Valid values are BASIC, DIGEST, NONE, NTLM, and NEGOTIATE. Default is BASIC.
  • Proxy_AuthToken: The proxy authentication token.
  • Proxy_SSLType: The SSL type of the proxy server. The allowed values are AUTO, ALWAYS, NEVER, TUNNEL. The default value is AUTO.

Firewall

  • Firewall_Server: The IP address or host name of the firewall. Source is firewall_host.
  • Firewall_Port: The port number of the firewall. Source is firewall_port.
  • Firewall_User: The user Id used to authenticate with the firewall. Source is firewall_user.
  • Firewall_Password: The password used to authenticate with the firewall. Source is firewall_password.
  • Firewall_Type: The type of the firewall. Source is firewall_type. Valid values are NONE, TUNNEL, SOCKS4,and SOCKS5. Default is NONE.

Other

  • Internalconfig#: Sets an internal configuration setting.
  • Charset: The charset of the exchanged/transferred data. Default is UTF-8
  • HTTPVersion: Version of the HTTP protocol to use. Valid values are 1.0 and 1.1. Default is 1.1
  • FollowRedirects: Whether or not to follow HTTP redirects. Valid values are TRUE and FALSE. Default is TRUE.
  • SSLCert: The SSL certificate to be accepted from the server. Any other certificate will be rejected. This can take the form of a full PEM certificate, the path to a file containing the certificate, the public key, the MD5 thumbprint, or the SHA-1 thumbprint. If not specified any valid certificate will be accepted. Default is TRUSTED
  • SSLClientCert: The name of the certificate store for the client certificate.
  • SSLClientCertType: The store type of the client certificate. Valid values are USER,MACHINE,PFXFILE,PFXBLOB,JKSFILE,JKSBLOB,PEMKEY_FILE,PEMKEY_BLOB,PUBLIC_KEY_FILE,PUBLIC_KEY_BLOB,SSHPUBLIC_KEY_BLOB,P7BFILE,P7BBLOB,SSHPUBLIC_KEY_FILE,PPKFILE,PPKBLOB,XMLFILE,and XMLBLOB
  • SSLClientCertPassword: The password of the client certificate.
  • SSLClientCertSubject: The subject of the client certificate. Using an asterisk will find the first certificate in the store.

Output Parameters

  • ssl:issuer: The issuer of the SSL certificate.
  • ssl:subject: The subject of the SSL certificate.
  • statuscode: The HTTP status code returned from the request.
  • content: The content of the HTTP response.
  • cookie:*: The cookies returned with the response.
  • allcookies: All of the cookies from the response, returned as a single string.
  • header:*: The headers returned with the response.

Example:

    <api:set attr="URL" value="http://www.example.com/target">
    
    <api:set attr="file:#1" value="C:/path/to/file" />
    <api:set attr="name:#1" value="testAttachments" />
    <api:set attr="filename:#1" value="myFile.json" />

    <api:call op="httpops.upload" />
  

Copyright (c) 2026 CData Software, Inc. - All rights reserved.
Build 26.0.9770