HTTP Connector Examples - Mule 4

To fully benefit from using Anypoint Connector for HTTP (HTTP Connector), see the following examples of configuring the connector both in Anypoint Studio and Design Center.

HTTP Connector Studio Examples

The following examples illustrate how to configure the connector in Anypoint Studio:

  • Start an App from a Browser
    Configure the HTTP Listener operation to start an app from a browser.

  • Consume a REST Service
    Configure both the HTTP Listener and HTTP Request operations to consume a REST service.

  • Load a Static Resource
    Configure both the HTTP Listener and HTTP Load static resource operations to load a static resource.

  • Route HTTP Requests to Different Paths
    Configure the HTTP Listener operation and Logger component to route HTTP requests to different paths.

  • Route Requests Based on HTTP Method
    Configure the HTTP Listener source to route requests based on HTTP methods.

  • Post a Form
    Configure the HTTP Listener source, Choice Router and Set Payload components to post a form by sending HTTP requests.

  • Set HTTP Error Status and Reason
    Configure the HTTP Listener source and the Validation Module, Set Payload, and Error Handler components to set the error status code and reason phrase for a user login validation request.

HTTP Connector Design Center Examples

The following examples illustrate how to configure the connector in Design Center:

  • Start an App from a Browser
    Use Design Center to configure the HTTP Listener operation to start an app from a browser.

  • Consume a REST Service
    Use Design Center to configure both the HTTP Listener and HTTP Request operations to consume a REST service.

  • Create an HTTPS Listener
    Use Design Center to configure the HTTP Listener secured by TLS 1.2 to start an app.

  • Set Up Basic Authentication
    Use Design Center to configure the HTTP Listener and HTTP Request operations, and the Basic authentication, to provide a user name and password when making a request.