HTTP adapter request and response for a PUT action
The PUT action is similar to the post action except that the PUT action can also send a data file to the URL. The PUT action requires the enclosed document to be stored under the specified URL.
Data is sent in the following formats using the PUT action:
- Simple text data
- XML data using <parent> and <child> elements
The following figure describes the elements of an HTTP adapter request with a PUT action.
Elements of an HTTP adapter request with a PUT action
Element | Description | Required |
---|---|---|
<adapter-name> | Specifies the name of the adapter | No |
<action> | Specifies the URL for the target page | Yes |
<use-ssl-certificate> | Determines whether to establish a secure connection | No |
<install-certificate> | Determines whether to install certificates | No |
<allow-unsigned-certificate> | Specifies whether to allow unsigned certificates from trusted zones | No |
<passphrase> | Specifies the Java Standard Trust Keystore passphrase Verify the cacerts passphrase using the following command in UNIX or Linux: | No |
<file-path> | Specifies the path of the file to be sent to the URL | No |
<file-content-type> | Specifies the content type of the file to be uploaded Valid values: For text: text\plain For files: application/octet-stream (Required for using multipart/form-data for sending multiple files over the adapter request) | Conditional; used if the adapter request contains a <file-path> element |
<data-format> | Indicates the data type for the adapter response | No |
<data> | Contains the data to be posted
Note: When you specify the <Content-Type> as multipart/form-data in the HTTP request header, you must specify at least one <entry> for the request. NEW IN 20.19.01 For a multipart/form-data request, you can now specify the content type as application/json in the request body. For a sample adapter request, see Sample adapter request for a multipart/form-data request when the content-type is application/json. | No |
<ntlm-authentication> | Indicates whether to use NTLM authentication for the target server for the specified user credentials | No |
<user-name> | Specifies the user name required for basic authentication | No |
<password> | Specifies the password corresponding to the user name provided for basic authentication | No |
<character-set> | Specifies the supporting CharSet | No |
<http-connection-properties> | Specifies an XML document that includes HTTP connection properties, which contain the <user-name> and <password> elements for basic or NTLM authentication | No |
<include-expect-header-in-request> | Specifies whether to include the expect header in the adapter request Note: By default, the expect header is included in the request. Valid values: true (default), false | No |
<user-name> | Specifies the user name required for basic or NTLM authentication specified in <http-connection-properties> | No |
<password> | Specifies the password corresponding to the user name specified in <http-connection-properties> | No |
<signature-properties> | Contains the elements that specify information about the public key (X.509 certificate) and the private key that are used for the digital signature
| No |
<keystore-file> | Specifies the path to the JKS that contains the client certificate | Conditional; required when <signature-properties mode="keystore"> |
<key-password> | Specifies the password of the key contained in the JKS | No |
<keystore-password> | Specifies the password to the JKS | Conditional; required when <signature-properties mode="keystore"> |
<alias> | Specifies the name of the alias in the JKS that identifies the Public Key Certificate (PKC) that the web server uses to authenticate the client | Conditional; required when <signature-properties mode="keystore"> |
<private-key-file> | Specifies the file containing the private key that is used to sign the HTTP request
| Conditional; required when <signature-properties mode="key-files"> |
<certificate-file> | Specifies the file containing the public key (X509 Certificate)
| Conditional; required when <signature-properties mode="key-files"> |
<private-key-data> | Contains an XML file specifying the private key in an Base64-encoded PEM format | Conditional; required when <signature-properties mode="key-data"> |
<certificate-data> | Contains an XML file specifying the public key (X509 Certificate) in an Base64-encoded PEM format | Conditional; required when <signature-properties mode="key-data"> |
<enable-json-conversion> | Specifies whether the adapter should treat the input data in the request and the data received in the adapter response as a JavaScript Object Notation (JSON) string
| No |
<request-timeout> | Specifies the time (in seconds) to wait when establishing a connection | No |
<ignore-line-break-in-response> | Specifies whether to ignore the line breaks while generating the adapter response If true, the line break markups are ignored and the response is returned as a single line. If false, the line break markers (if specified in the adapter response) are retained. Valid values: true (default), false | No |
The following figure shows a sample adapter request for a multipart/form-data request and when the file content type is application/json.
<http-connection-properties>
<Content-Type>multipart/form-data</Content-Type>
<Authorization>AR-JWT eyJhbGciOiJIUzI1NiJ9.eyJzdWI..............</Authorization>
</http-connection-properties>
<action>http://clm-pun-sqm9ge:8008/api/arsys/v1/entry/sample_attach</action>
<data>
<entry>
<key>entry</key>
<value><![CDATA[{
"values" :
{"Submitter__c" : "Allen", "Short Description__c" : "Test", "Attachment__c" : "Task.txt"}
}]]></value>
<content-type>application/json</content-type>
</entry>
<entry>
<key>attach-Attachment__c</key>
<value>C:\Shared\Task.txt</value>
<content-type>application/octet-stream</content-type>
</entry>
</data>
</http-adapter-request>