Send HTTP Request

Send HTTP Request is an asynchronous activity that sends an HTTP request and waits for a response from the web server. This activity sends a request to a server that is compliant with either the HTTP 1.1 or 1.0 specification. TIBCO® Cloud Integration automatically sends the request using the correct version based on the version supported by the HTTP server. Therefore, do not specify the HTTP version of the server you are sending the request to.

General

Note: When configuring an HTTP activity, configuring an HTTPConnector Shared Resource as the value for a module property is not supported. Configure a literal value instead.

The General tab has the following fields.

Field Description
Name The name to be displayed as the label for the activity in the process.
HTTP Client Specifies the HTTP Client shared resource. For details, refer to HTTP Client.
Parameters The parameters of the HTTP request. For each parameter, you must provide:
  • Parameter Name
  • Parameter Type as string
  • Parameter Cardinality as Optional, Required, or Repeating

These parameters are specified in the parameters element on the General tab.

Post Data Type The body of the HTTP message. You can select either String or Binary format.

Description

Provide a short description of the activity.

Input Editor

Input Editor comprises the data structure of the headers of the HTTP request and HTTP reply message. You can either use the default structure or modify the structure, if the outgoing request or the reply to the request has a specific data structure for the header.

Input Header Datatype Description
Accept string This field specifies media types that are acceptable for response messages for the request. For example, text/*, text/html. Media types are described in the HTTP specification.

If no Accept-Header field is specified, all media types are acceptable on the server.

Accept-Charset string This field specifies the character sets that are acceptable for response messages for the request. For example, iso-8859-5, unicode-1-1. The character sets are described in the HTTP specification.

If no Accept-Charset header is specified, any character set is acceptable on the server.

Accept-Encoding string This field specifies the content-coding values that are acceptable for response messages. For example, compress and gzip. See HTTP specification (http://www.w3.org/Protocols/Specs.html) for more information about this header field.
Content-Type string This field indicates the media type of the entity body for the outgoing message and the incoming response. Media types are described in the HTTP specification. An example of the media type is text/html; charset=ISO-8850-4.
Cookie string A name and value pair (also known as a cookie) containing information that the HTTP server may be expecting. You can set the cardinality for this element to Repeating (*) to specify more than one cookie. You can also specify multiple name or value pairs in a single non-repeating element by separating each pair with a comma (for example, "name1=value1, name2=value2").
Pragma string This field is used to include implementation-specific directives that might apply to the receiver. See the HTTP specification (http://www.w3.org/Protocols/Specs.html) for more information about using this field.

Output Editor

Output Editor comprises the data structure of the headers of the HTTP request and HTTP reply message. You can either use the default structure or modify the structure, if the outgoing request or the reply to the request has a specific data structure for the header.

The header structure is defined by the HTTP protocol. See the HTTP protocol specification for more information about the fields and content of the header of an HTTP request. You can obtain this specification at http://www.w3.org/.

Output Header Datatype Description
Allow string This field lists the set of methods supported by the resource identified by RequestURI.
Content-Type string This field indicates the media type of the entity body for the outgoing message and the incoming response. Media types are described in the HTTP specification. An example of the media type is text/html; charset=ISO-8850-4.
Content-Length string This field indicates the size of the entity body (in decimal number of OCTETs) of the response message.
Content-Encoding string This field is used as a modifier to the content-type. When present, its value indicates what additional content encoding has been applied to the entity-body. Also, what decoding mechanisms must be applied to obtain the media-type referenced by the Content-Type header field.

Content-Encoding is primarily used to allow a document to be compressed without losing the identity of its underlying media type. See the HTTP specification for more information about this field.

Date string The date and time when the response message was sent.
Location string This field is used to redirect the receiver to a location other than RequestURI for completion of the request or for identification of a new resource.
Set-Cookie string If you want to receive more than one cookie, set the cardinality for this field to Repeating (*).

See the HTTP specification for more information about this field.

Pragma string This field is used to include implementation-specific directives that might apply to the receiver.

See the HTTP specification for more information about using this field.

Input

The following is the input for the activity.

Input Item Datatype Description
Host string The HTTP host you want to connect to. Specifying a value for this input item overrides any value specified on the General tab.
Port string The port number that the HTTP server uses for incoming requests. Specifying a value for this input item overrides any value specified on the General tab.
Method string The HTTP method to use for the request. All HTTP 1.1 methods are supported, but the connect method is unnecessary because TIBCO® Cloud Integration automatically uses the CONNECT method when connecting through a proxy server.

If no method is specified in this element, the GET method is used by default.

RequestURI string The address portion of the request. This is the portion of the URI before the question mark (?).
PostData string The message body of the HTTP request. Do not specify this element when the method of the request is GET.

For details on this input element, refer to Sending Data in the HTTP Request

QueryString string The query string portion of the request. This is the part after the question mark (?).

For details on this input element, refer to Sending Data in the HTTP Request

Timeout integer The amount of time (in milliseconds) to wait for a response from the HTTP server.
Headers complex The header fields to send for the request. When this element is specified on the Input Editor tab, you can use this input item to provide values for the header when sending the request.
DynamicHeaders complex The dynamic header is an additional header parameter to add runtime headers to the outgoing HTTP messages. This element is specified in the Input tab.
Note: You can use only US-ASCII characters in DynamicHeaders.

The DynamicHeaders consists of the following information:

  • Name: the name of the header
  • Value: the value of the header

You can consider the following overriding conditions.

  • Overrides the value of HeaderName with the value found in DynamicHeaders if it is a non-repeating header. If more than one occurrence of this header is found under DynamicHeaders, it throws the following exception.

    The header [ headerName ] is defined as non-Repeating Header in Input Headers. This header cannot have multiple occurences in DynamicHeaders.

  • If it is a repeating element, add the respective name value pairs under dynamic headers, which is then added to the existing list maintained for this element.
  • For a repeating element, if the new header name is not found under the "Headers" section declared through TIBCO Business Studio™, the following is added into HTTP Headers.
    • Shows only one value, if found once in DynamicHeaders.
    • Shows an array of values, if found repeating in DynamicHeaders.
mimeEnvelopeElement complex This element contains the message attachments.

This element contains a repeating element named mimePart that contains each mime attachment.

mimeHeaders complex This element contains the mime header for each mimePart. mimeHeaders can contain the following information:
  • content-type
  • content-transfer-encoding
  • content-id

See http://www.faqs.org/rfcs/rfc2045.html for more information about MIME headers and their syntax.

Note: When the content type is specified as "text/*" (for example, "text/xml"), the attachment content is in the textContent input element. When the content type is anything other than "text/*", the attachment content is in the binaryContent input element.
binaryContent | choice This element contains the mime attachment.

The element is binaryContent: the content of the attachment when the attachment is binary data.

Output

The following is the output of the activity.

Input Item Datatype Description
Header complex The fields of the header specified on the Output Editor tab. See the description of the Output Editor tab for more information about these items.
StatusLine complex This field is the first line of the response message. This consists of the protocol version, a numeric status code, and the text phrase explaining the status code.

See the HTTP specification for more information about status codes in the HTTP responses.

httpVersion string The HTTP method to use for the request. All HTTP 1.1 methods are supported, but the connect method is unnecessary because TIBCO® Cloud Integration automatically uses the CONNECT method when connecting through a proxy server.

If no method is specified in this element, by default the GET method is used.

statusCode string The address portion of the request. This is the portion of the URI before the question mark (?).
reasonPhrase string The message body of the HTTP request. Do not specify this element when the method of the request is GET.

For details on this input element, refer to Sending Data in the HTTP Request

binaryContent string The binary content of the response to the request from the HTTP server.
asciiContent integer The ASCII content of the response to the request from the HTTP server.
Headers complex The header fields of the reply. The structure of this output item is specified on the Output Headers tab.
DynamicHeaders complex The dynamic header is an additional header parameter to add runtime headers to the outgoing HTTP messages. This element is specified in the Input tab.
Note: You can use only US-ASCII characters in DynamicHeaders.

The dynamic headers consist of the following information:

  • Name: the name of the header
  • Value: the value of the header

You can consider the following overriding conditions.

  • Overrides the value of HeaderName with the value found in DynamicHeaders if it is a non-repeating header. If more than one occurrence of this header is found under DynamicHeaders, it throws the following exception.

    The header [ headerName ] is defined as non-Repeating Header in Input Headers. This header cannot have multiple occurences in DynamicHeaders.

  • If it is a repeating element, add the respective name or value pairs under DynamicHeaders, which is added to the existing list maintained for this element.
  • For a repeating element, if the new header name is not found under the "Headers" section declared through TIBCO Business Studio™, the following is added into HTTP Headers.
    • Shows only one value, if found once in DynamicHeaders.
    • Shows an array of values, if found repeating in DynamicHeaders.
mimeEnvelopeElement complex This element contains the message attachments.

This element contains a repeating element named mimePart that contains each mime attachment.

mimeHeaders complex This element contains the mime header for each mimePart. mimeHeaders can contain the following information:
  • content-type
  • content-transfer-encoding
  • content-id

See http://www.faqs.org/rfcs/rfc2045.html for more information about MIME headers and their syntax.

Note: When the content type is specified as "text/*" (for example, "text/xml"), the attachment content is expected to be in the textContent input element. When the content type is anything other than "text/*", the attachment content is in the binaryContent input element.
binaryContent | textContent choice This element contains the mime attachment.

The element can be one of the following:

  • binaryContent: content of the attachment content of the attachment when the attachment is binary data.
  • textContent: content of the attachment when the attachment is text data.

Fault

The Fault tab lists the possible exceptions thrown by this activity.

Fault Thrown When..
ActivityTimedOutException The timeout for the activity is attained.
HttpClientException The HTTP server responds with a message containing the 4XX status code.
HttpServerException The HTTP server responds with a message containing the 5XX status code.
HttpCommunicationException An HTTP exception occurred while executing the specified method, or when trying to read the response.

Threading Policy Details

The following are the details about Send HTTP Request activity threading policy.

Activity Type Multi-Threaded? Default Thread Count Thread Count Configuration
Asynchronous Yes Dynamic You can configure it by using the Thread Pool shared resource.

Policy

Activities that support policies will display the Policy tab. To associate a new or existing policy with the Send HTTP Request activity, click the Add Policy to Activity icon. To edit policy details, click Go to selected Policy icon. The Policy tab has the following fields.

Field Description
Name The name of the policy.
Type The type of policy associated with the activity. The Send HTTP Request activity can support the Basic Credential Mapping policy.
Description A description of the policy.