Contact Free trial Login

Anypoint Exchange

Home to the complete listing of connectors, templates, examples and APIs.
Discover and use proven assets built by the MuleSoft ecosystem, or add assets to a private
tenant of Anypoint Exchange for collaboration and sharing of internal best practices.

HTTP Request Response with Logger

HTTP Request Response with Logger

(0 reviews)

Learn how to use Mule to build a simple HTTP request-response application.

Screenshot of the main flow from Anypoint Studio


This example application illustrates how to use Mule ESB to build a simple HTTP request-response application. After reading this document, and creating and running the example in Mule, you should be able to leverage what you have learned to create a very simple HTTP request-response application. Also, this example was designed to demonstrate interaction between an end user and Mule via an HTTP request, and Mule's ability to log activity in the application.

Example Use Case

In this example, an user calls the Mule application by submitting a request via his browser (i.e. entering a specific URL, http://localhost:8084/echo). The application receives the request and returns the same payload, or "echoes", the response to the end user. In other words, when an user types http://localhost:8084/echo into the address bar of her browser, Mule returns a message in the browser that reads, /echo (see image below, left); if she enters http://localhost:8084/moon, Mule responds with /moon (below, right).

There are two functions the Echo example application illustrates:

  1. it receives HTTP requests and returns HTTP responses
  2. it logs the requests it receives

Set Up and Run the Example

As with other example templates you can create template applications straight out of the box in Anypoint Studio or, in this case, also in Mule Standalone where this example is called echo. You can tweak the configurations of these use case-based examples to create your own customized applications in Mule.

Follow the procedure below to create, then run the HTTP Request-Response with Logger application.

  1. Create, then run the example application in Anypoint Studio or Standalone.
  2. Open your Web browser, type http://localhost:8084/echo in the address bar, then press enter.
  3. Your browser presents a message that reads, /echo.
  4. In your browser’s address bar, replace the word echo with the word moon, then press enter.
  5. Your browser presents a message that reads, /moon.


Read full documentation in GitHub

Examples to Try Next

If you understood this example
Filtering a Message - Learn how to use filter components to filter an incoming message.View
If you struggled with this example
Hello World - The first applications you should get running with Mule.View


Log into Anypoint Platform to download this asset


Created by
MuleSoft Organization
Published onJun 22, 2017


VersionRuntime version
Show more