Postman call: http://localhost:8081/united
Response code 404 mapped as failure. Message payload is of type: BufferInputStream
HTTP Listener Configs:
Host: All Interfaces [0.0.0.0] (Default)
Port: 8081
Path: /united
HTTP Request Configs:
Host: mu.mulesoft-training.com
Port: 80
Base Path: /essentials/united/flights
URL Settings Path: /essentials/united/flights
In Postman the URL http://mu.mulesoft-training.com/essentials/united/flights returns all flight data as you would expect.
{
"flights": [
{
"airlineName": "United",
"price": 400,
"departureDate": "2015/03/20",
"planeType": "Boeing 737",
"origin": "MUA",
"code": "ER38sd",
"emptySeats": 0,
"destination": "SFO"
},
{
"airlineName": "United",
"price": 345.99,
"departureDate": "2015/02/11",
"planeType": "Boeing 737",
"origin": "MUA",
"code": "ER45if",
"emptySeats": 52,
"destination": "LAX"
},
{
"airlineName": "United",
"price": 346,
"departureDate": "2015/04/11",
"planeType": "Boeing 777",
"origin": "MUA",
"code": "ER45jd",
"emptySeats": 12,
"destination": "LAX"
},
I'm on a personal machine and not behind a firewall.
Try the following example here :-
<http:listener-config name="HTTP_Listener_Configuration" host="0.0.0.0" port="8081" doc:name="HTTP Listener Configuration"/>
<http:request-config name="HTTP_Request_Configuration" host="mu.mulesoft-training.com" port="80" basePath="/essentials/united/flights" doc:name="HTTP Request Configuration"/>
<flow name="getUnitedFlightsFlow">
<http:listener config-ref="HTTP_Listener_Configuration" path="/united" allowedMethods="GET" doc:name="HTTP"/>
<http:request config-ref="HTTP_Request_Configuration" path="/" method="GET" doc:name="HTTP"/>
</flow>
Now, if you hit the url :- http://localhost:8081/united it will wok fine as you can see in the following screenshots :-