Build an API Gateway REST API with HTTP Integration
Last Updated :
28 Mar, 2023
Pre-requisite: AWS
We can use either the HTTP proxy integration or the HTTP custom integration to build an API using HTTP integration. When feasible, leverage HTTP proxy integration for faster API setup while delivering varied and strong functionality. If it is essential to change client request data for the backend or backend response data for the client, HTTP custom integration might be appealing.
HTTP proxy integration is a simple, powerful, and adaptable way of creating an API that allows a web application to access numerous resources or features of the integrated HTTP endpoint, such as the full website, using a single API call. API Gateway sends the client-submitted method request to the backend via HTTP proxy integration. Request headers, query string parameters, URL path variables, and payload are all part of the request data that is passed through. The backend HTTP endpoint, often known as the web server, parses the incoming request data to determine the answer. Except for known limitations such as unsupported characters, which are noted in Amazon API Gateway’s important notes, HTTP proxy integration allows the client and backend to connect directly with no interference from API Gateway when the API method is set up.
You can use an HTTP proxy integration to establish an API of a single API method using the all-encompassing proxy resource {proxy+} and the catch-all ANY verb for the HTTP method. The method exposes a website’s whole collection of publicly available HTTP resources and actions. When the backend web server makes more resources available to the public, the client can use them using the same API configuration.
The following lesson serves as an overview of HTTP proxy integration. In this tutorial, we will construct an API using the API Gateway interface to interact with the PetStore website using a generic proxy resource {proxy+} and the HTTP method placeholder ANY.
Steps To Build an API with HTTP Proxy Integration with the PetStore Website through a Proxy Resource
Step 1: Access the API Gateway console by going AWS console.
Step 2: Choose Build from the REST API menu. Choose OK when the Create Example API box displays.
Step 3: Choose New API.
Step 4: Enter a name in the API Name.
Step 5: Add a brief description in the Description field if desired.
Step 6: Click Create API.
Step 7: Pick a parent resource item from the Resources tree and then choose to Create Resource from the Actions drop-down menu to create a child resource.
Step 8: To create a proxy resource, select the Configure as proxy resource option.
Step 9: Use the default name proxy in the Resource Name input text field.
Step 10: Use the default name /{proxy+} in the Resource Path input text field.
Step 11: Select Enable API Gateway CORS.
Step 12: Click Create Resource.
Step 13: Choose ANY from the HTTP method drop-down list, then click the check mark button to preserve your selection.
Step 14: Choose HTTP Proxy for Integration type.
Step 15: use http://petstore-demo-endpoint.execute-api.com/{proxy} for the Endpoint URL.
Step 16: Use default settings for other fields and click Save to finish configuring the ANY method.
The API’s proxy resource path of {proxy+} becomes the placeholder of any of the backend endpoints under http://petstore-demo-endpoint.execute-api.com/ in the newly established API. For example, It can be a pet store, pet store/pets, or the pet store/pets/{petId}. At runtime, the ANY method acts as a placeholder for any of the available HTTP verbs.
Steps To Test an API with HTTP Proxy Integration
Step 1: In the Resources tree, choose ANY on a proxy resource.
Step 2: In the Method Execution window, select Test.
Step 3: Choose to GET from the Method drop-down list.
Step 4: In place of the proxy resource path ({proxy}), use pet store/pets for Path and type=fish for Query Strings.
Step 5: Leave other settings as it is.
Step 6: Click Test to test invoking the method.
Step 7: Because the backend website accepts the GET /pet store/pets?type=fish request, it returns the following successful response:
Step 8: If you attempt to call GET /pet store, you will receive a 404 response with the error message Cannot GET /pet store. This is because the provided operation is not supported by the backend. Because the PetStore website supports GET /pet store/pets/1, you will receive a 200 OK response with the following payload.

Similar Reads
Build an API Gateway REST API with Lambda Integration
Pre-requisite: AWS Amazon Web Services is a leading cloud provider which provides us with plenty of Paas, and Iaas, and services that we can use to build and deploy our applications. we going to build and Deploy a REST API with API Gateway which is integrated with AWS Lambda and expose GET and POST
4 min read
Networking and API Integration in Android
Networking is a great way to connect your application with the world. Yes, before going straight into our topic, let's first try to find its necessity in your application. Networking is an essential aspect of modern applications, allowing them to connect with servers, databases, APIs, and other appl
9 min read
How to Build an API With Ruby on Rails?
Ruby on Rails API refers to the application programming interface (API) framework provided by the Ruby on Rails (Rails) web application framework. It allows developers to build and expose APIs for their web applications efficiently. Ruby on Rails is a popular web development framework written in the
4 min read
Amazon Web Service - Introduction to API Gateway
Firstly, API stands for Application Program Interface. An API Gateway is a management tool that acts as an interface between users and microservices. The Amazon API Gateway is an AWS service that allows users to create, publish, secure, maintain and monitor APIs at any scale. You can create APIs in
12 min read
Securing Spring Boot API With API Key and Secret
In Web applications, securing the APIs is critical. One of the common methods of securing the APIs is by using API keys and secrets. This ensures that only the authorized clients can access the API endpoints. This article can guide you through the process of securing the Spring Boot API using the AP
6 min read
Testing REST API with Postman and curl
In the world of API testing, there are many tools available. Postman and cURL are two of the most popular tools for it. Let's look at how to use these tools for testing them. We will send some HTTP requests and explore the basic syntax for both of them in this article. The article focuses on using a
7 min read
Create a REST API as an Amazon Kinesis Proxy in API Gateway
Pre-Requisite: AWS Amazon Kinesis is a managed, scalable, cloud-based service that enables real-time processing of enormous amounts of data per second in real-time. It is intended for real-time applications and lets developers collect an unlimited amount of data from many sources, scaling up and dow
4 min read
Difference Between REST API and RPC API
REST and RPC are design architectures widely used in web development to build APIs (Application Programming Interface). It is a set of instructions that permits two systems to share resources and services. The client creates a request to the server that responds to it with data in JSON or XML format
3 min read
Create a REST API as an Amazon S3 Proxy in API Gateway Automation
Amazon Web Services is a leading cloud provider which provides us with plenty of Paas, and Iaas, and services that we can use to build and deploy our applications. we gonna build and Deploy a REST API with API Gateway which acts as a proxy to S3 and can be used to perform Read/Write on S3 without an
5 min read
How to Communicate with Backend Services using HTTP in Angular?
To communicate with backend services using HTTP in Angular, you typically use the HttpClient module, which is part of the @angular/common/http package. This module allows you to interact with RESTful APIs, fetch data, submit forms, perform CRUD operations, and more. PrerequisitesMongoDBExpressJSAngu
7 min read