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.0, 1.1, or 2.0 specification. HTTP 2.0 is supported only when the HTTP version at the client shared resource is set to HTTP 2. TIBCO BusinessWorks™ Container Edition 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
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 more information, see HTTP Client. |
Parameters | The parameters of the HTTP request. For each parameter, you must provide:
These parameters are specified in the parameters element on the Input tab. |
Post Data Type | The body of the HTTP message. You can select either String or Binary format. |
Advanced
The Advanced tab has the following fields.
Field | Literal Value/ Module Property | Description |
---|---|---|
Provide Client Resource | None | Select this check box to dynamically select the needed HTTP client resource. When you select this check box, Host and Port fields disappear, and the ClientResource field appears in the Input tab. |
Write to File | None | Select this check box to write the incoming requests that exceed the specified threshold size to a file instead of storing the request in memory. You can accept large incoming requests without consuming a great deal of memory. Selecting this check box displays the Directory and Threshold Data Size fields. |
Directory | Yes | The directory to write messages that are above the specified threshold. The process engine does not attempt to create the directory if the specified directory does not exist. Therefore, create the directory before starting the process engine. |
Creating Non-Existing Directories | None | Selecting this check box creates all directories in the path specified in the
Directory field, if they do not already exist.
Not selecting this check box with one or more non-existing directories in the specified path in the Directory field, raises an exception. |
Threshold Data Size(bytes) | Yes | The maximum size (in bytes) of an incoming request to be kept in memory. Requests larger than the specified size are written to a file in the specified directory. The file’s name is the output so that subsequent activities in the process can access the file and read its contents.
Specifying zero (0) in this field causes all incoming requests to be saved to a file. |
Write Non MIME Content | None | Select this check box to save the non-MIME attachments or data downloaded from the server to a disk. |
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 at w3.org.
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 at w3.org.
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.
For more information about this header field, see HTTP specification at w3.org. |
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 at w3.org. 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. For correct parsing and processing of cookies, input must be in the format "key=value".
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.
For more information about this field, see the HTTP specification at w3.org. |
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 HTTP protocol defines the header structure. For more information about the fields and content of the header of an HTTP request, see the HTTP specification at 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 at w3.org.
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. For more information about this field, see the HTTP specification at w3.org. |
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 | The cardinality for this field is set to Repeating (*).
For more information about this field, see the HTTP specification at w3.org. |
Pragma | string | This field is used to include implementation-specific directives that might apply to the receiver.
For more information about this field, see the HTTP specification at w3.org. |
Input
The following is the input for the activity.
Input Item | Datatype | Description |
---|---|---|
ClientResource | string | This field appears when you select the
Provide Client Resource check box on the
Advanced tab. Provide the HTTP client shared resource name to which you want to connect dynamically.
The client resource name to be provided in the input tab should be of the form <Package Name>.<Resource Name>. |
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 BusinessWorks Container Edition 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 | HTTP status codes in output represent the status of a service. The status code helps to identify the cause of an error. For more information, see Status Code and Reason Phrase at w3.org. |
PostData | string | The message body of the HTTP request. Do not specify this element when the method of the request is GET.
For more information about this input element, see Sending Data in the HTTP Request |
QueryString | string | The query string portion of the request. This is the part after the question mark (?).
For more information about this input element, see 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.
The DynamicHeaders consists of the following information: You can consider the following overriding conditions.
If you add any Standard HTTP Header as a name value pair in the Dynamic Header section in the client end, on the server side this is listed under the Headers section. |
parameters | complex | This element contains parameters added in the Parameters field in the General tab. |
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:
For more information about MIME headers and their syntax, see http://www.faqs.org/rfcs/rfc2045.html. Note: When the content type is specified as
"text/*" (for example,
"text/xml"), the attachment content is in
either
the
textContent input element or the file name storing the attachment is in the
fileName input element. When the content type is anything other than
"text/*", the attachment content is in
either
the
binaryContent input element or the file name storing the attachment is in the
fileName input element.
|
binaryContent | textContent | fileName | choice | This element contains the mime attachment.
The element can be one of the following: |
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.
For more information about these items, see the description of the Output Editor tab. |
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.
For more information about status codes in the HTTP responses, see the HTTP specification at w3.org. |
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 BusinessWorks Container Edition 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 | HTTP status codes in output represents the status of the service. The codes also help to identify the problems caused. For more information on the standard HTTP status codes, see Status Code and Reason Phrase at w3.org. |
reasonPhrase | string | The message body of the HTTP request. Do not specify this element when the method of the request is GET.
For more information about this input element, see 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. |
filePath | string | The location of the file on the disk at which the non-MIME attachment is written . |
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.
The dynamic headers consist of the following information: You can consider the following overriding conditions.
|
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:
For more information about MIME headers and their syntax, see http://www.faqs.org/rfcs/rfc2045.html. Note: When the content type is specified as
"text/*" (for example,
"text/xml"), the attachment content is expected to be in either the
textContent input element or the file name storing the attachment is expected to be in the
fileName input element. When the content type is anything other than
"text/*", the attachment content is in
either
the
binaryContent input element or the file name storing the attachment is in the
fileName input element.
|
binaryContent | textContent | fileName | choice | This element contains the mime attachment.
The element can be one of the following: |
Fault
The Fault tab lists the possible exceptions generated by this activity. For more information about error codes and the corrective actions to take, see the TIBCO BusinessWorks™ Container Edition Error Codes guide.
Fault | Generated When.. |
---|---|
ActivityTimedOutException | A timeout has been reached. |
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. |