http method setter

HTTP Method Setter

Version: 17.07

Supported Since: 17.01

What is a HTTP Method Setter?

HTTP Method Setter processing element set the configured HTTP method for the out going HTTP calls. All HTTP method types are allowed to set using this processing element.

In order to use this processing element, you must first select the HTTP NIO Connector dependency from the connector list when you are creating an empty Ultra project. If you have already created a project, you can add the HTTP NIO Connector dependency via Component Registry. From Tools menu, select Ultra Studio → Component Registry and from the Connectors list, select the HTTP NIO Connector dependency.

http method set outports

Out Ports

Next

Message will be emitted from this port after changing the HTTP method from the configured value

On Exception

The message context will be sent to this outport if any exception occurred while setting the HTTP method

Parameters

HTTP Method *

Basic

HTTP method to for out going HTTP calls

Sample Use Case

In the following use case, the requirement is to mediate messages to a web service which calls to an external API to get data and prepare a response for user requests. This web service accepts HTTP POST requests and the external API only supports HTTP GET method.

Prerequisite

In order to implement above use case you must first select following dependencies when you are creating an empty Ultra project

  • HTTP NIO Connector from the connector list.

  • Content Extractor and Transport Header Manager dependencies from the processor list.

If you have already created a project, you can add above dependencies via Component Registry. From Tools menu, select Ultra Studio → Component Registry and from the Connectors list and Processors list, select above dependencies
Implementation

For the implementation we should extract out required parameter from the received JSON message using the JSON Path Extractor and then add the extracted value as a query parameter and then send the request to the external web service as a GET request by changing the the HTTP method.

To implement above use case, first let’s create our integration flow named “http-method-setter-sample". Then add an NIO HTTP Ingress Connector and configure the request receiving service path and port.

After that JSON Path Extractor should be added to extract the Symbol which received at the $Organization.Symbol JSON path and then hen Add Query Parameter processing element should be added to set the extracted Symbol value as the query parameter for the out going HTTP request.

Next processing element should be the HTTP Method Setter processing element to set the HTTP method to GET. This will set the current HTTP method as GET and this point onwards all the out going HTTP calls will be considered as HTTP get requests for this particular flow. HTTP Method Setter processing element should be configured as below to change the HTTP method,

http method setter 1

As the final element, HTTP Egress Connector should be added to send out the GET HTTP call to the external API.

With all above elements, complete integration flow would be like this,

http method setter 2

Now run your integration flow and send a request message to the configured request URL to test your integration flow. Once you send a request, check with the flow tracing, you should be able to see that the x.http.method message property has been changed from POST to GET after the HTTP Method Setter processing element.

In this topic
In this topic
Contact Us