There are many use cases where you might want to route HTTP requests to different target groups based on the HTTP methods. For example, you have one target group with low processing power to serve static page for all GET requests. At the same time, you have another target group with high processing power that hosts a web application to handle all the POST requests.
1. When you click the “GET” button, a HTTP GET request is sent to the “exampleloadbalancer” demo Application Load Balancer.
2. There are two routing rules configured on the Application Load Balancer.
Rule1: The Application Load Balancer returns a fixed response static page for any GET requests for path /arr_method.
Rule2: The Application Load Balancer routes any POST requests for path /arr_method to a Lambda target group which parses the city data in the POST request and returns the weather information of the given city
3. The HTTP method name that you configured has to be an exact match with the HTTP method in the request.
4. Wildcards are not supported in the match string and method name is case-sensitive.
5. Custom methods are supported. For example you can use method like RENEW, ALLOC, FIND etc. Only upper case alphabets (A-Z), hyphen (-) and underscore ( _ ) are allowed characters in the method name. Examples VERSION-CONTROL, CUSTOM_METHOD, ALLOW etc. The limit on maximum number of characters in method name is 40 and the method name is case-sensitive.
6. There are two routing rules configured to demonstrate how custom HTTP method works.
Rule1: Custom HTTP method is CAT. The Application Load Balancer returns a fixed response static page for any CAT requests for path /arr_method.
Rule2: Custom HTTP method is DOG. The Application Load Balancer returns a fixed response static page for any CDOG requests for path /arr_method.
Please select the city that you want to query for its weather information
You can use the follow commands to send requests through CAT or DOG custom HTTP method
curl -XCAT https://www.exampleloadbalancer.com/arr_method
curl -XDOG https://www.exampleloadbalancer.com/arr_method